Publish artifact in package registry work with one repo but not another

Hello Community,

I am building a CI/CD for a java project (an apache nifi nar).

A gradle job publish my nar on my package registry.

I hard coded my url for tests and run my job on my project with Id : 987654321.

When I want to publish on this url : https://gitlab.com/api/v4/projects/987654321/packages/maven

It does not work.

But when I set an url with the Id of another project with Id : 123456789

On these url : https://gitlab.com/api/v4/projects/123456789/packages/maven

It works.

My project are on the same group.

What blocks the publish of my artifact on my project : 987654321

My partial job :

publishing {
    publications {
        maven(MavenPublication) {
            artifact 'build/libs/' + project.name + '-' + project.version + '.nar'
        }
    }
    repositories {
        maven {
            url = "https://gitlab.com/api/v4/projects/123456789/packages/maven"
            credentials(HttpHeaderCredentials) {
                name = "Private-Token"
                value = System.env.GITLAB_PRIVATE_TOKEN
            }
            authentication {
                header(HttpHeaderAuthentication)
            }
        }
    }
}