Ok - that’s fine - I was forgetting that the production deployment paths are different!
We might have located a bug with a migration where there could be puppet repos left over when they should have been removed.
You can try opening the foreman console and run:
::Katello::ContentViewPuppetEnvironment.destroy_all
Then retry the upgrade.