Couldn't read the full thread but this earlier statement stood out to me:
*Don't have time to read through, but I know two people whose children are similar (hideously behaved at home, clingy to mom/alternating with being vile to her, poor sleepers), but reasonably well behaved at school. Both are on the spectrum.
You might want to have her assessed*
My DS also has ASD and SPD. He is highly anxious. At this age he would have tantrums meltdowns over things I couldn't control - different types of floors (they scared him), ceilings, lights, his clothes he'd chosen, foods, parties etc. I'd always remove him but it didn't change the behaviour because it was born out of anxiety. He never wanted to be separated from me, again because of fear.
He was a terrible sleeper - up and down all night and barely napped in the day as a baby.
He was diagnosed with ASD aged 6 and given melatonin to help him sleep. Getting more sleep helped him, although we've had to put a lot of strategies in place as well. He copes really well now (he is 10).
One thing I noticed is you seemed slightly dismissive of a spectrum condition as your DDs speech is good. So is my DS - in fact at this age his was advanced. But that is usual for high functioning spectrum conditions. What is also common in spectrum conditions is rudeness, having met downs over uncontrollable things (you mentioned that) and high anxiety (her not wanting to leave you could be due to that).
XP and I split up partially because of differences in parenting. There were other issues too, but I recognised early on there was possible ASD whilst XP labelled it bad behaviour and just wanted to punish harshly (shutting an anxious 2 year old in his room all night with no lights because they were 'stimulating' so that he wouldn't come in and bother us. And of course it didn't work, it just left DS terrified of being alone in a dark room until he was about 8).
Try setting some consistent boundaries as suggested here and giving them a reasonable length of time to take effect (I find 2-4 weeks), but after that consider taking her to the GP to ask for a developmental assessment.