This isn't a bug, but rather a common desynchronization issue. A better connection won't help here. Most often, it happens that each player sees the opponent's turn, but sometimes the battle ends with different results for each player. This can occur due to a poor connection (internet) or different versions of the game.
Auto-translated