Your router needs to support 802.11k for devices to reliably switch between wifi networks using the same SSID.
This is normally a feature offered by enterprise or pro-consumer equipment.
This is normally a feature offered by enterprise or pro-consumer equipment.