You can cheat to get cheats on after creating a world with cheats off. If you start a LAN and enable cheats, you can do all commands. This is like: "Oh no I fell in lava! But, that's not a problem, I just need to start a LAN and enable cheats, then I can fly out from the lava and everything is as normal.". And that's not supposed to happen, I think.
The cheats can be disabled if you rejoin the world.
You could do this since LAN was added.
Linked issues
duplicates 2
Comments 4
If cheats is disabled when creating a world, you shouldn't be able to change gamemode or enable cheats in LAN settings.
Confirmed, but possibly intended, as you also have an option to change the gamemode to creative. If 'Open to LAN' has that option, it is very likely that enabling cheats is intended behavior.