Error #102: Lost contact to website error on open URL command if there is redirect

I see this error “Error #102: Lost contact to website” when I have a redirect on the page. Means before the original URL opens, it opens to a single sign on page and then redirects back to the original URL from the open command.
It also happens if I run the script in an external IDE window.
Note sure it happens all the time but mostly always.