Has your dd ever been assessed for ADHD?
It can present very differently in girls, but one of the main signs i see in myself is sudden outbursts of anger which come and go in a flash, and then all you can do is apologise knowing that it will happen again but you don't know why.
For me i have identified it's when i get overwhelmed. I can be fine, then i get too hot, or hungry, or too many noises and i snap. My dc are the same, so i have to continually ensure we keep everything to a strict routine, that they are prepared for exactly what will happen and that they don't get overwhelmed. I've learned through my own experience that if they lash out, or have a meltdown that often they need a cuddle before we can talk about what happened. Sometimes i really don't want to cuddle them, but i have to because punishing just escalates things. I'm teaching them self soothing techniques and breathing exercises so i can get them to calm down in the moment and talk about why they got overwhelmed.
Me and dh cop all of the bad behaviour because they don't feel safe to unmask at school or at other people's houses. So i definitely get where you're coming from. You're her safe space, so she feels safe to unleash all of that but that doesn't make it any easier for you of course.
Id have a read of adhd in girls, and autism in girls and see if any of it resonates with your daughter.
If she is ND, chances are you might be as well so could be why you're also struggling.
Im not trying to diagnose you both but it's worth looking into.