So i run a java server on a computer and that computer has become too slow, so i took the world and placed it back as a normal single player world. I then optimized the world for 1.18.1. Now half the commands are missing for normal single player worlds such as gamerule... I attached the world data below. if i need to send it some other way let me know. The Server was a java server running the latest version. You also cannot access a command block... and command blocks are not able to execute their commands.
It sounds like you lost your operator privileges in the server. You could try to execute this command in the server console (Not the minecraft chat, the actual console), or ask another server admin to do so for you to see if you get access to those commands.
And, while in a singleplayer world, you could try to open the world to LAN with cheats ENABLED. Either of those should fix your problems.