Could be ADHD or is there any trama?
I have ADHD and I had a lot of trama as a child. I spaced out because I wanted good grades but unless I found a lesson really interesting and connected with the teacher I checked out.
In high school I got rebellious and simply walked out of class.
I developed a "loud" personality because of my impulse brain but as a small child I was away with the faries.
I recommend a test. While uou wait try fresh air and exercise. If I get some energy out it's easier to concentrate and sleep. Being still is often uncomfortable for me.Help you child get organised but follow her lead, ADHD people do things their own way, be patient and show love.
You seem to concentrate on grades but also look at her social skills. Girls can be mean to anyone different. Chat about friendships ans teach basic social skills without trying to change her.
Also get therapy, a stressful environment makes things worse and you are a lot of her environment.
I really regret not getting meds until my 40s, I could have had a lot more in life.
On the bright side your daughter is probably sensitive and creative.