Same issue but mine has a different cause. Check your acr - settings - properties - role assignment permissions mode, which one do you have?
RBAC Registry + ABAC Repository Permissions
RBAC Registry Permissions
If you've selected "RBAC Registry + ABAC Repository Permissions" and didn't assign extra roles https://learn.microsoft.com/en-us/azure/container-registry/container-registry-rbac-abac-repository-permissions?tabs=azure-portal you won't be able to push image. For me, I just changed it to "RBAC Registry Permissions", then "unauthorized" error was gone.