Foreman master using wrong upstream

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

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 va-prod-repo01.myrepo.com:443 ssl:default [Connect call failed (‘172.18.181.7’, 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.