Since the day the game was released, Niantic Labs augmented reality game Pokemon Go has undergone several game updates to maintain the game's stability and some feature additions. However, it seems like bugs are inevitable and constantly reappearing. Currently, some players complains about being kicked out of the gym while in the midst of a battle and unable to enter it later on.
According to Heavy, this recent bug might something to do with errors on the GPS, which mostly inaccurate. For instance, your in-game character continues to walk around even if you are physically standing. This type of problem is dubbed as GPS drift. This happens every time even when you are in a gym. When this happens, your avatar will leave the certain range resulting into a forced exit.
As reported, the aftermath of the forced exit will cause players banned from entering the gym for 10 minutes. This is the primary reason why you see an unknown red error message after being kicked out. Based on the sources, Niantic might consider this banning system to prevent GPS spoofers from taking over the gym easily. However, legit players are the most affected ones on this reported bug. It would be so frustrating to be booted out after spending all your Pokemon on a tough battle.
One player posted a complaint on Reddit stating that it is way too annoying knowing that almost gyms are made up of 9-10 Pokemon and just being booted out after spending 9 Pokemon into the battle. Worst thing is that it will restrict players from entering for 10 minutes. The cause of this glitch had multiple branches. However, one particular branch which is highly recognized is the faulty GPS.
Until Niantic fixes everything, it was suggested that players will have to wait for 10 minutes to cool down whenever you encounter this kind of bug. It is quite understandable that this is indeed disappointing and a waste of time. However, some reports said that the ban wears off a bit earlier between 5-6 minutes.
This recent glitch is again a big slap for Niantic Labs as Pokemon Go continues to lose its players due to frustration. However, some are still hopeful that the company will turn things around and regain its players back.
Meanwhile, here's a video of a related gym bug issue.