Ever since the ban hammer on Pokemon Go cheaters was dropped hard, there are several claims that honest players also have been banned for no reason.
OtakuArt.com has warned Pokemon Go trainers not to leave their Pokemon in Pokemon gyms for the meantime. As of this writing there is an ongoing worldwide ban override that targets Pokemon currently occupying gyms. The recent bans are said to be unintended and coming from a flaw in Niantic's ban algorithm, where the system bans an account from 3 unique reports. So whether you did something 'illegal' or not the report against you will be counted. Because of this glitch, if 3 separate users report you regardless of its validity, you will still get banned.
At this point, it is recommended that you do not leave your high CP Pokemon in gyms until the issue is resolved. The higher your CP, the more likely you will get reported of cheating even though you worked hard for your Pokemon 'to be the very best' If you urge for gym battles just for experience grinding, you can use your low to mid-level Pokemon. This way, those jealous active reporters will ignore your Pokemon.
It is unconfirmed as of this moment as Niantic Labs has not released a statement against claims of users being banned for no valid reasons neither a statement released on the assurance of the non-existence of random bans. It is reported that travelers, mostlikely mistaken as teleporters, are most likely to receive random bans from the API. OtakuArt.com also states that the ban system is all messed up alerting fellow Pokemon Go trainers. They also have supplied a link in case you get banned from the game.
In the meantime, you may want to check out some Youtube videos on how to battle properly.