I would not override a coach or health care provider's recommendation unless behavior was really, truly, that awful. And in that case, we'd probably be evaluating her participation in all extra-curriculars in general (including practice).
If she's cleared to compete, and coaches would like her to, I'd have her compete what she can. Some kids thrive more under pressure. Perhaps she'll warm up the two iffy events amazingly and they'll let her compete. Or perhaps she'll warm them up well and it'll just build confidence which would carry over to the gym. Or perhaps she doesn't warm them up at all.
Where is the negative behavior happening? I've noticed that when my kids' attitude is the crappiest, it's when she most needs a hug and support. If I punish a negative attitude (beyond "go to your room and think about what you just said"), it worsens. I acknowledge that her behavior sucks and is inappropriate when I need to, but it's conversational, and not usually accompanied by punishment. I ask her what is going on to make her behave such a way, and offer a sounding board and a hug. We also discuss healthier ways to deal with it. Growing up is rough, and sometimes (often) they don't have the emotional maturity/intelligence to process or communicate appropriately. She may be frustrated/scared/worried and unable or unwilling to communicate that. That said, every kid is different and I'm speaking in generalizations and am totally not telling you how to parent.... perhaps you're completely aware. But withdrawing your daughter from the competition alone in light of her attitude is likely to exacerbate the behavior rather than correct it, especially if gymnastics is a primary outlet for her. You need to get to the root cause of her current attitude, and let her know the feelings are ok but that crappy behavior is not.