Please make sure that you are connected to a steady network, whether it is Wi-Fi or mobile data (3G/4G). Even if connection bars are full, it does not always guarantee a solid Internet connection, because networks can slow down or get overburdened at times, especially when you are playing in a moving vehicle.

Keep in mind that you may lose connection with the game if you are inactive for about a minute and this behaviour of the game is not a mistake.