Cannot connect to public Wi-Fi: "a problem occurred"
Using Cmd + Spacebar, Open System Preferences -> Network -> Wifi -> Advanced -> DNS

In the DNS section, remove all the DNS addresses and search domains and apply the new settings, so that the public wifi could use the one that it is configured with.