As far as I can tell this is either a bug with how the devs implemented dynamaxing, or a problem with the config option "Old Gen Dimensions" which apparently effects what parts of the game use gen 7 mechanics and what parts use gen 8 mechanics. But i have no idea how it works, all the setting itself says is 72. it doesn't give any details for how changing that value affects the game, but for some reason that value allows gen 7 mechanics for anything other than trainer battles. I can also have multiple active values for some reason, for this setting. Alternatively this is a bug with how dynamax was implemented, that being you can have either dynamax or mega evolution in a battle (why not just add a restriction that prevents a mega pokemon from dynamaxing) but for some reason it's implementation broke mega evolution, but only for trainer battles somehow.
On a side note our server used to have the gameshark addon active but now it just doesn't work despite us both still having it.