Error parsing HTTP 403 - building docker image

Running Gitlab version 14.8.2, same version for the Runner, which is a simple shell.
This is my yaml ci file:

variables:
  REPOSITORY: $CI_REGISTRY/acme/test/test-acme/master

before_script:
  - export PATH=$PATH:/usr/local/go/bin
  - docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
 
build_image:
  script:
    - echo -e "machine gitlab.acme.com\nlogin gitlab-ci-token\npassword ${CI_JOB_TOKEN}" > $HOME/.netrc
    - git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.acme.com".insteadOf git@gitlab.acme.com
    - go mod download
    - go build
    - docker build -f Dockerfile.A4B -t $REPOSITORY:latest .
    - docker push $REPOSITORY:latest

This is the output:

Running with gitlab-runner 14.8.2 (c6e7e194)
  on gitlab-runner-4 QxNeqEeQ
Preparing the "shell" executor 00:00
Using Shell executor...
Preparing environment 00:01
Running on gitlab-runner-4...
Getting source from Git repository 00:00
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /home/gitlab-runner/builds/QxNeqEeQ/0/acme/test/test-acme/.git/
Checking out aa26121e as master...
Removing test-acme
Skipping Git submodules setup
Executing "step_script" stage of the job script 00:02
$ export PATH=$PATH:/usr/local/go/bin
$ docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /home/gitlab-runner/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
$ echo -e "machine gitlab.acme.com\nlogin gitlab-ci-token\npassword ${CI_JOB_TOKEN}" > $HOME/.netrc
$ git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.acme.com".insteadOf git@gitlab.acme.com
$ go mod download
$ go build
$ docker build -f Dockerfile.A4B -t $REPOSITORY:latest .
Step 1/8 : FROM registry.acme.com/acme/base/docker-go-runtime/master
Head "https://registry.acme.com/v2/acme/base/docker-go-runtime/master/manifests/latest": error parsing HTTP 403 response body: no error details found in HTTP response body: "{\"message\":\"access forbidden\",\"status\":\"error\",\"http_status\":403}"
Cleaning up project directory and file based variables 00:00
ERROR: Job failed: exit status 1

I can log in with no problem but once I try to build the image it seems I’m not authorized. The Dockerfile.A4B is this:

FROM registry.acme.com/acme/base/docker-go-runtime/master
....

If I do a pull like this it works just fine:

docker pull registry.acme.com:5050/acme/test/test-zip/master

UPDATE
I noticed that if I change my Dockerfile.A4B with this:

FROM registry.acme.com:5050/acme/base/docker-go-runtime/master

Instead of this:

FROM registry.acme.com/acme/base/docker-go-runtime/master

basically adding the port 5050 at the end it works.
So I’m wondering something wrong with the repository configuration?
Funny thing is that if I create a deploy Token and I login doing this:

docker login registry.acme.com -u gitlab+deploy-token-2 -p password

And I have full rights read and write, but when then I try to do a docker build like this it fails:
docker build -f Dockerfile.A4B -t registry.acme.com/acme/test/test-zip/master:latest .

Sending build context to Docker daemon 24.47MB
Step 1/8 : FROM registry.acme.com/acme/base/docker-go-runtime/master
error parsing HTTP 404 response body: unexpected end of JSON input: “”

which is slightly different