Group/project path updates break the Container Registry
### Summary
When a project under a team namespace has images in its registry, moving the team namespace is possible but moving it back under the initial namespace generates an error.
Deleting all container images and tags in the Gitlab projects container registry does *not* help.
This is a problem for reusing names and namespaces. If the namespace ever held images, it cannot be reused (e.g. by renaming an existing namespace to that namespace).
### Steps to reproduce
1. Create a team `team1`
1. Create a project under `team1` called `fakeproject`
1. Push an image to `team1/project`. This succeeds.
1. Move (not rename, move) the `team1` team to `team2`. This succeeds. The image is still there and has been moved to `team2/project/image`
1. Attempt to move `team2` back to `team1`. This does not succeed.
1. Delete the `team2/project/image` image in the Gitlab container registry page. This seems to succeed, the image does not appear on the page anymore.
1. Attempt to move `team2` back to `team1` again. This still does not succeed, same error message.
The error message:
> “Namespace team1 (1268) cannot be moved because at least one project (e.g. project (2522)) has tags in container registry"
### Example Project
(If possible, please create an example project here on GitLab.com that exhibits the problematic behaviour, and link to it here in the bug report)
(If you are using an older version of GitLab, this will also determine whether the bug has been fixed in a more recent version)
### What is the current *bug* behavior?
The error message:
> “Namespace team1 (1268) cannot be moved because at least one project (e.g. project (2522)) has tags in container registry"
### What is the expected *correct* behavior?
Assuming that the namespaces are free, moving `team1` to `team2` and later `team2` to `team1` should succeed.
### Relevant logs and/or screenshots

This happens on Github Community Edition v11.7.4.
## Possible workaround
1. unsigned images: https://gitlab.com/gitlab-org/gitlab/-/issues/18383#note_215002790
1. user provided bash script: https://gitlab.com/gitlab-org/gitlab/-/issues/18383#note_333696073
1. 3rd-party tool: https://github.com/containers/skopeo/blob/main/docs/skopeo-sync.1.md to download images to the local machine, after retrieving the tag list for each container repository (and each project) using the GitLab API in a custom script:
- https://docs.gitlab.com/ee/api/container_registry.html#list-packages
- https://docs.gitlab.com/ee/api/container_registry.html#delete-registry-repository
<!-- triage-serverless v3 PLEASE DO NOT REMOVE THIS SECTION -->
*This page may contain information related to upcoming products, features and functionality.
It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes.
Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.*
<!-- triage-serverless v3 PLEASE DO NOT REMOVE THIS SECTION -->
issue