When the Data engine is restarted it sometimes fails and in the data_engine log it reports that it has obtained a read only connection to the database.
The "Test Connection" button is greyed out in data_engine.
The data_engine is configured to connect to the SQL Availability Group listener.
Have the availability group configuration changed to not allow connections to the secondary replica
to configure this:
This will prevent any accidental connections to the secondary by the data_engine.
SQL Server Always on High Availability Groups are documented by Microsoft® here.