PokeYeeter Thanks for letting us know the bug.
You can also get kicked by Anti-Cheat For The Following Reasons:
1) By having bad Internet Broadband speed
2) Having more ping than usual i.e 200+
3) Or the opponent that you are opposing with, is lagging.
4) Could be your device not able to handle Minecraft. Which also causes lag.