Is it a glitch or program in battles

Quite often maybe 3-4 times a day I get the early opponent wins during the battle match game isn’t finished yet so had to log out and back in that takes battle times yes I have a couple of screen shots but it’s like oppobent wins then I win when I complete the battle.