I went down this path recently - contacting different brokers (HiveMQ, AWS, nrfCloud). While the broker may support keepalive times past 12 hours, the limitation is the load balancers and other underlying TCP connection settings. This limits MQTT KA to something like 30 minutes for practical usage (for all major brokers I talked to) unless you set up your own custom broker hosted on a machine that won't break the TCP connection. Try backing off to a keepalive time of ~1700 seconds maximum.
I went down this path recently - contacting different brokers (HiveMQ, AWS, nrfCloud). While the broker may support keepalive times past 12 hours, the limitation is the load balancers and other underlying TCP connection settings. This limits MQTT KA to something like 30 minutes for practical usage (for all major brokers I talked to) unless you set up your own custom broker hosted on a machine that won't break the TCP connection. Try backing off to a keepalive time of ~1700 seconds maximum.