After having had a chat with a kind representative from GitHub Developer Support, it seems like it in my case had to do with my old username and password credentials that was saved on my machine. I quote:
Sometimes applications can use these old credentials, even if you replace it with the personal access token.
Credentials for git authentication are stored in the Keychain App, and git passes these onto GitHub when pushing changes to a Repository.
I'd suggest checking in the Keychain App for any records with the name
GitHub
.If they exist, delete those and try the push again.
Git should ask you to enter your username and password and once you re-enter them, the correct credentials should be stored in your Keychain app for future use.
So there you have it. This in fact solved my problem. It could also have had something to do with the personal access token that might not be set up with the proper permissions. If you have the same problem as I had you could also check out the scopes on your personal access token to verify it has access to everything you need. Step 7 on the help guide below has a screenshot of what that looks like:
https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line