Can you launch the same url in your web browser without any problems? This will help to see if your IP can actually connect to Gitlab or not. Does it show 503 in web browser as well? Sometimes an IP can be blocked and not accessible, so you may want to debug this by enabling a VPN to a different location and then try accessing.
If the web browser works, but Selenium doesn’t, then that would mean most likely something in the code.
Also, the screenshot you posted isn’t for the API. Otherwise it would be gitlab.com/api/v4/ and to use API, depending on what commands you are using, it may also require providing an access-token to authenticate with. Perhaps that is also a reason why you cannot gain access as you are attempting an API command that requires you to be logged in.