Got ERR_TUNNEL_CONNECTION_FAILED in Chrome and no idea why? Try the same proxy from Python, because it’ll tell you what the browser won’t. Chromium drops every CONNECT reply except 200 and 407, so you can’t tell a policy block from a dead exit in there.
Python leaves the status in the exception text. You’ll see OSError: Tunnel connection failed: 502 Bad Gateway from http.client, and requests wraps that in a ProxyError with the same words inside.
I’d read that string before retrying anything, since a blanket except ProxyError plus a retry loop just burns time on errors that can’t heal. A 403 is usually policy, sometimes just a port they don’t allow. 407 means check your login. If you get 405 or 501 you aren’t talking to a forward proxy at all. Only 502, 503 and 504 are worth backing off on, those happened behind the proxy.
Disclosure: we run a proxy service, none of this depends on whose.

