I added a new repo with the command:
helm repo add <name> <url> --username <user> --password <pass>
Then, when trying to pull a chart from it with:
helm pull <repo_name>/<chart_name> --version "$chart_version" --untar
I am getting 401 Unauthorized.
Helm version is 3.6.1. Locally with version 3.1.2 everything works as expected
It turns out it is a bug with v3.6.1, adding the repo with --pass-credentials
To know more refer to this issue and this other
Edit: version 3.6.3 also works as expected