I have also found this to be an issue.
Reproducing it is as simple as
I join the server and everything is fine. I am currently connected and have been for 15 minutes without issue as soon as I get a friend to join I am immediately kicked by operator despite the fact I am the only operator which must mean it's the server doing it. I am on version 1.12.1 on the PC and so are my friends. This doesn't happen however if two of my friends attempt to join and I do not join. It's only me who kicks people and gets kicked if people join.
Owner connects > Everything Fine > Another Friend Connects > Owner is kicked > Owner attempts to rejoin > Kicks Friend > Owner Joins > Friend attempts to connect > Owner is kicked > Friend Joins > Friend Joins > Everything is fine > Owner attempts to join > Kicks everyone.
Turns out, I found the fix for this.
It's as simple as reverting your minecraft to 1.12.0 instead of 1.12.1. Something in the new update is causing the issue. Me and my friends all switched to 1.12.0 and have had no issues since. If you do not know how to do this follow the below steps;
Open Minecraft Launcher > Click Launch Options > Add New > Name it "1.12" (Doesn't matter really but, this is simple) > Version set to Release 1.12 > Save > Go back to "News" > Select the arrow next to Play > Select 1.12 > Launch the game. You're done. =)
You will have no issues with your realms either. They appear to be compatible with 1.12.0