This happens regardless of whether the world is open to LAN or not. Steps to reproduce:
If the commands are not enabled then enable them.
Try it first when the world is not open to LAN.
Go to the «World Options» tab.
Press F3+N.
The game mode changes, but this does not happen visually and the switch is still on «Creative».
Go back to this tab.
You will see that the switch is now on «Spectator».
Now open the world to LAN and do the same thing.
The same thing will happen, the game mode switch will not change visually only after re-entering there.
Thank you for helping us improve Minecraft! We saved your files: