In your scenario, did your environment requires proxy to access the internet. If that is a case, please configure the proxy follow this article: Configuring proxy settings for the On-premises Data Gateway.
In addition, you can restart on-premises data gateway services, and remove older gateway config file if you have installed gateway on this computer before. for more information, please refer to this article: Troubleshooting the On-Premises Data Gateway.
If you have any question, please feel free to ask.
Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.