My availability group doesn't work correctly
Can you confirm you have the correct permissions on the endpoint?

USE master;
GO
SELECT SUSER_NAME(principal_id) AS endpoint_owner
    ,NAME AS endpoint_name
FROM sys.database_mirroring_endpoints;
GO

-- change the endpoint owner
USE master;
GO
ALTER AUTHORIZATION ON ENDPOINT::Hadr_endpoint TO sa;
GO

-- grant connect
GRANT CONNECT
    ON ENDPOINT::Hadr_endpoint
    TO [yourdomain\username]; -- account used for the SQL Service