Check that you're on a new enough version where main is actually the default, not master.
Also, there's no reason why you can't just switch branches? Just create a main branch from whereever (either right at the start after init or at some later point) and push it, then delete master.
Also literally thr first result when googling how to set the default branch name: https://superuser.com/questions/1419613/change-git-init-default-branch-name set it to main manually if it won't do it automatically
E: regarding the errors when pushing to main, I assume you tried git push origin main while on the master branch. That doesn't work because git only wants to push to same-name branches. However, you can do git push origin master:main, which means "push this branch master to the remote origin and rename it to main".