There's an epidemic of children struggling with this. My eldest is one of them.
OP I sympathise and if you haven't already sought them out I can highly recommend joining two FB groups (which have thousands upon thousands of parents dealing with the same issues, and lots of useful advice):
"Not Fine in School: Family Support for School Refusal and Attendance Issues"
(they also have a website rich in useful material if things get difficult with school
"School Refusal Support Services for Phobia, Refusal and Separation Anxiety".
My DD is an academic high flyer and well liked by her peers (i.e. no obvious problems) but has completely refused to go to school since Sept 18, after three years of increasing difficulty in getting her there.
After years of various schools saying she's fine (despite us and her saying she's not), she's now been diagnosed with severe audio hypersensitivity, Irlen syndrome (visual stress) and is on the waiting list for ASD assessment.
She is now doing InterHigh at home, maybe something to consider.
I've given up on schools. They just don't get it, and even when they do, the system they work within completely sidelines children like my DD. We were threatened with prosecution for non-attendance, despite a doctor's letter, for example. As a result we're been forced into de-registering which makes us look like we are electively home schooling (and therefore not eligible for funding for online school), even though we're not.