In my experience, any failed exception like "unable to hit XYZ endpoint" usually implies there's a proxy or firewall blocking your connection.
I recommend performing connectivity checks specifically for Internet connectivity, registration endpoints and operation endpoints- steps detailed here
Proxy and firewall configurations must allow the Hybrid Runbook Worker agent to communicate with the registration endpoint. For a list of addresses and ports to open, refer to the Network planning guide. (also posted below)