As you have already set the PAT using the environment variable you don't need to again login using az DevOps login.
To use a PAT, set the AZURE_DEVOPS_EXT_PAT environment variable at the process level.
export AZURE_DEVOPS_EXT_PAT=xxxxxxxxxx
Your bash task is not setting up the environment variable. For that you can add the environment variable declaration to the AzureCLI task and that should work.
env:
AZURE_DEVOPS_EXT_PAT: $(pat_token)
I hope this will help you.