Fix EnvSpec check in envs.Metadata
Fixing everything to a degree that the pipeline would pass ended up being a bit complicated. Things are still very much fragile because the switch to Gymnasium apparently isn't complete yet. But because pre-commit only checks files that have been modified, I managed to get to a point where it was happy.
@mischenk Have a look over this when you have time and hit merge if you're happy with the changes!