Registry login does not work with token or $CI_REGISTRY_USER and $CI_REGISTRY_PASSWORD, but with regular user

I have a local installation of GitLab-CE 16.3 via Docker. After importing some projects from another GitLab instance (older version) some pipelines don’t work any more. The login to the Docker registry via

docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY

does not work any more. The error message is:

Error response from daemon: Get "https://git.foobar.de:4567/v2/": unauthorized: authentication required

I then tried to login from the machine where the Gitlab Docker container are running. Any attempt to login via token does not work. However, I can successfully login with my personal user credentials.

I have seen the hint on Authenticate with the Container Registry | GitLab that I have to disable external authorization to use tokens. It is disabled. I have no idea, why I can´t login with any other credentials than my personal ones.

Do you have an idea?