Your Ditto must have Tranformed to the sprite of G-Max Cinderace but not Gmax Cinderace.
It is evident from
If a Pokémon transforms into a Dynamax Pokémon, it will successfully
transform but not become Dynamaxed. Transformed Pokémon can Dynamax,
unless they are transformed into Zacian, Zamazenta, or Eternatus.
Transform does not copy the Gigantamax Factor, so even if a Pokémon
transforms into a Pokémon that can Gigantamax, the transformed Pokémon
will be able to Dynamax but not Gigantamax. If the target is Eternamax
Eternatus, the user transforms into the regular version of Eternatus.
So your Ditto would have just copied the Sprite.
But still its very abnormal for this to happen. Itwill become just a normal Cinderace as stated abovein the case of Eternatus.
See this Battle to see what actually happens when you send out a Ditto during opponents Dyanamax.
Hence it must be a Glitch
Hope I Helped