My friend kind of had this problem, her daughter moved in with her two small boys, after splitting with her partner. There is no way she could stay with him. She is a good mother though, and took full responsibility for her boys. My friend also had a grown up daughter in the house. They were in a three bed bungalow....very small.
It took 3 plus years, to get housing. It took its toll on my friend, who had to work, but the blessing was...they all got on.
The problem here is...even though there are things you can do, everything takes so long, unless there is abuse to the child, and then they are, or should be...removed.
If it were me...and I can only imagine your torment, so apologies if I’m making it sound easy, I would pack my daughter’s bags...and tell her to live with all these friends she keeps seeing. My grandchild would stay with us, and we’d get right on to Social Services. My daughter would have to fight for her. She is the only priority^. Would your health allow for this?
Can your sons help at all? How do they view everything? You can’t continue like this. Even if your sons moved out....you still presumably would be left with your daughter behaving the same. She may even take more liberties, as she would see there’s more space.
I’m so sorry, it sounds a nightmare, but I think if you focus on your granddaughter now...then maybe you can get your daughter the help she needs.
I wish you all the best?