Foreman master using wrong upstream

We changed upstream servers and Foreman still tries the old one
Expected outcome:
Use the new one
Foreman and Proxy versions:

New upstream set in our products and all content views were published. When trying to download a file from this repo, we get the following error on the master:

May 24 08:02:37 sv-prod-foreman01 pulpcore-content[285464]: Backing off download_wrapper(…) for 0.0s (aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host ssl:default [Connect call failed (‘’, 443)])

Some of rpms in this same repo are OK, and all seem accessible from the proxies. Just the master this is affecting.
I have tried to reclaim space, restart services (including pulp), and clear orphans with:
foreman-rake katello:delete_orphaned_content

Same result

I’ve manged to workaround this issue but setting the download policy to immediate (was on-demand) and resyncing. Not sure if setting back to on-demand will break it again or why Foreman was caching the old content from the wrong upstream.