Disable automatic switching to 4G from WiFi which doesn't have internet connection
Put your iPhone into Airplane Mode to disable the cellular connection. Then re-enable Wi-Fi networking (you can do this even in Airplane mode). This will cause it to stick with the Wi-Fi network.