Are the two PBX's both remote and with two different public IPs?
Was the DNS and A-record configured to solve this issue? The fact that you mention configuring a DNS leads me to believe that the Passive server is configured to use the FQDN of the Active server. If that's the case, I'd recommend using the Active server's IP address in the "IP address of ACTIVE server" field as per our guide:
https://www.3cx.com/docs/failover/
Also, what options have you set here and what failed on the Active server the last couple of times the failover failed:
View attachment 25815
Depending on the situation, the failover may not trigger based on these settings.