Maintenance plan: Confirmed server as primary but switched to secondary during backups?
We use ola hallengren backup scripts/jobs and that does check the cluster settings for each database.

For each database it will check, can I backup this database?, using the cluster settings and current cluster status. So if your AOAG is set to only allow backups from the Primary it wont backup a database that is currently a secondary.

Works great for us, the only issue we run into is the currently running DB backup will usually fail during a failover event because all connections are briefly severed.