When Apple connects to a wireless network, it often pops up that the network is unavailable.
See this Apple article: If your iPhone, iPad, or iPod touch won’t connect to a Wi-Fi network
https://support.apple.com/en-us/HT204051
Read also the article at the top left of this thread.
When you are outside your home see this Apple article: Use captive Wi-Fi networks on your iPhone, iPad or iPod touch
https://support.apple.com/en-gb/HT204497
please switch to cellular data
Go to -> Settings -> Mobile network -> Mobile data -> Turn it On.
Mobile data options -> Data roaming -> Turn it On.
To connect to Internet you need Wi-Fi or Cellular Data (a subscription or a prepaid with data).
If one is not available, the other is used to establish a connection.