Forcibly closed by the remote host

We are using script for onboarding data to Stardog. I would say that every second connection fails with such error:

There was a problem: HTTPSConnectionPool(host='', port=5820): Max retries exceeded with url: /admin/alive (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)))

When I run again the same script just after getting this error, everything works fine.

Do you know why I am getting such error and how i can avoid it?