I am having a similar issue as this, where some public wifi works on my iPhone and not on my Mac (Big Sur 11.6.1)
Other public wifi works fine.
Troubleshooting further, I see that the wifi itself connects, I got an IP address but the TCP connection times out when trying to connect to the captive portal. I can ping the IP where I get redirected (something like 126.96.36.199), but can't establish an HTTP connection on port 8000. It's a TCP issue rather than a cert error, because it doesn't even get a TCP connection established (confirmed with
curl -v). My phone can reach the same port and IP on the same wifi.
I suspect some settings might be blocking outbound TCP - where should I look? Settings & Privacy > Firewall seems to be focused on inbound connections.