pygithub create pull request GithubException "not all refs are readable"

I am using Pygithub to trying to create a pull request.

# push branch
cmd = ["git", "push", "origin", "HEAD:refs/heads/my-branch"]
subprocess.run(cmd, check=True)
...
# then create PR
repo = client.get_repo(MY_GITHUB_REPO)
repo.create_pull(title=title, body=body, head=my-branch, base="master")

I got his Exception

github.GithubException.GithubException: 422 {"message": "Validation Failed", "errors": 
[{"resource": "PullRequest", "code": "custom", "message": "not all refs are readable"}], 
"documentation_url": "https://docs.github.com/rest/reference/pulls#create-a-pull-request"}

I checked the branch exist on Github but I am getting this exception. I tried to run a git fetch origin before the repo.create_pull() but the error persisted. I am not sure how to get around this.