Hello,
the error message tells you that you do have access to the repo. There might be several reasons why this is the case, invalid password, token expired, 2FA, credentials aso. Make an internet search with “gitlab.exceptions.GitlabAuthenticationError: 401: 401 Unauthorized” see here.
Best wishes Jens