The reason for this can be that Wi-Fi is subject to rampant instability due to interference from other devices and is worsened by multiple walls, floors, other obstructions or even other Wi-Fi networks in close proximity.
We recommend that you play as close to the router as possible and check the strength of the Wi-Fi signal on your device.
For experienced users we recommend making sure that there are ideally no other Wi-Fi networks using the same or very close channels as their own.