Given the fact that her mega stone shattered, that’s definitely a sign that she’s pushed herself too hard. Taking her out of rotation (and perhaps listing her temporarily as a companion instead of a battle-ready pokémon) would be an excellent idea. Give her some time to rest. Then, when she’s more up for it, wean her slowly back into battling. Treat this as you would a physical injury and urge her not to push too hard to get back onto the battlefield.
Best of luck with this, by the way, and may she get well soon.