I think the suggestion to figure out what is going wrong at school, and leave gymnastics out of it (but keep her in it for now) is a good one. The problems existed before gymnastics, and gymnastics is the one area where she is succeeding- that's what seals it for me.
Plus I have a bit of life experience in this area. I was a smart, underperforming child. I just never did my homework, though I did pay attention in school and always did well on tests. Still, I had some ADD issues (undiagnosed) and my work habits were very poor- I can tell you some stories that would make type A personalities cringe! Part of my problem was that my parents were fairly undisciplined people and didn't really try to consistently enforce any kind of discipline in my life. I think a competitive sport like gymnastics would have been GREAT for me. It probably wouldn't have gotten me to always do my homework on time, but I think I would have learned a bit about discipline and commitment and work ethic, from a different angle.
I did get to do competitive swimming for 2 years (4th - 5th grade), which was great for me, but sadly my team fell apart when the coach left and my mother didn't want to drive me to the next closest pool. Plus I think she was not cut out to be a team kid's mom- that whole discipline thing. Anyway I do remember after my first year of swimming my teacher said that I probably should quit swim team because it was getting in the way of my homework. That would have been a tragedy- like your daughter, swim team wasn't keeping me from my homework, my complete boredom and inability to see the point was in the way of me doing my homework.
Lastly- the epilogue- I ended up going to the most competitive public high school in NYC, doing fairly well despite my poor work ethic which still plagues me to this day (still undiagnosed ADD), did pretty well but not exactly up to my potential in HS and College, went to a very prestigious (and expensive, oops) graduate school, and to this day remain a productive member of society who only spends some of my work day messing around on the internet. And I think my story is not that atypical of the bored, distracted, intelligent kid in our society. My biggest regret in life is that I didn't get to continue swimming- I got into sports again in college (not swimming and not on the varsity team level) but I feel that I missed a big opportunity to be part of something great and really work hard and reach my full potential athletically, if not academically.