My son (13) also has talked about quitting. We are in a different situation as he was injured before the shutdown and would not be able to practice anyway, but he was staying very motivated about doing what he could do, physically. The talk of quitting came up very recently and out of the blue, as his physical recovery is going well. What we are finding out with him is that his moodiness and negative thinking is not really about gymnastics or at least, not mostly about gymnastics. I think this is a crazy time where kids have lost lots of things without any consent and are feeling even more out of control than adults, and what may be going on at least partially is he sees quitting as a way to exert control over his life, or trying another sport as a way to change his life. A grass is greener type of thing. Of course it is not like he can actually start doing another sport right now, his injury precludes that even if there were no shut down. But this kind of thinking is not always rational.
This is a really tough time for kids like it is for everyone else. One thing I thought about recently is that I think boys in particular may struggle more with loneliness in the shutdown as they are typically more comfortable socializing in person and in groups, playing physical games, goofing around etc. Face to face convo with a friend on facetime or zoom feels weird according to my son. Of course each kid is different. Some may be having fears about the state of the world, or struggling with all the uncertainty about the future, some may have more personal reactions to all the changes or a combination. I personally think that the novelty has worn off and as shutdowns of normal activities wear on, kids- pre- teens and teens in particular- are going to struggle more and more.
I would suggest that when your son talks negatively just listen and resist the urge to problem solve or talk him out of his feelings- just let him vent. (I am terrible at this fyi)Try non-judgemental questions to encourage him to talk "Tell me more about why you want to quit." or "What differences in your life are you imagining if you do not do gym anymore?" (Those examples sound really awkward but hopefully you get the gist.) Maybe your kid has an interest in another sport or activity and has really thought this through, maybe he is just venting, maybe there is something else going on.
If he is working out with any regularity at all, that is quite good for a 12 year old in this situation in my opinion. If he is happy doing the amount of workouts the gym is offering great, but if not, maybe let him not do that every day if he would prefer not. Encouraging him to go outside to play or walk or socialize with peers any way your family feels is safe may help a little with his mood.