This is such a difficult issue. There are a few things I would recommend trying:

I would ask the teachers to do the following: For math, having her practice logic instead of mastering level-based skills. For reading/writing, making her write about/answer questions using advanced critical thought.

At home, it sounds like you guys are doing a great job focusing on developing her core self instead of academic progress. I like the parenting skill by Tina Payne Bryson of "Connect then redirect". When she gets upset about your direction, connecting with her emotions and validating how hard it is for her, then working on helping her practice coping skills to deal with those emotions (embarrassment, confusion, anger, shame, etc.).

Talk to her about the importance of failure, and mastering the skill of failure. Make it a game or goal. Have her play board games/card games using luck, and practice losing. Engage her in a new activity that she has to learn and fail at (knitting, a new sport, piano, etc.) and work on accepting failure as part of the learning process. Focus the activity more about learning how to fail than succeeding at the activity.

Ask her everyday to identify a strength of someone else that is not about success, such as kindness, helpful, brave, empathetic, etc. so she learns that intelligence and success are smaller than she is giving them credit.

Just some ideas, good luck!