I have experienced this bug in version 1.16.1 (bedrock edition).
Steps to reproduce:
Create a new single player world with cheats enabled
Have a second player join the game
Give the second player op
Have the second player deop the host
At this point the host will be unable to run most commands. This can be rectified by asking the second player to give the host op again.
This can also occur in 1.5 when just walking (no blocking or anything required).
I have observed this on servers that have large numbers of people, other side of the world, and many mods. I believe this is caused by slow communication between the server and client.
I use Windows 7 and my brother uses Windows xp. He can connect to my game, but I can't connect to his. Neither shows in the server list. Minecraft 1.4.6.
Verified the issue still exists in 1.17.1