CDC on Sql Server 2017 with HA cluster stopped working
it seems that the problem is generated by the fact that the database is not primary.
In fact it is read-only state. Try to fail back the relative AG group.
https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/perform-a-planned-manual-failover-of-an-availability-group-sql-server?view=sql-server-ver15
About the cdc job you need to have it in every node that of the AG cluster.
Take a look at how to manage cdc in an alwayson environment:
https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/replicate-track-change-data-capture-always-on-availability?view=sql-server-ver15