vSphere HA agent cannot be installed or configured
When you manually put ESXi server in maintenance mode it may fail to join HA after coming out of maintenance mode. Even if you restart the ESXi host and retry the HA joining operation it will fail with the timeout error.
It appears that vCenter server cache invalid data about ESXi host which was in maintenance mode, preventing it joining the cluster. If you do not have any job running on vCenter server then restart the vCenter server. When vCenter server reboots, ESXi host will automatically join the cluster. If vCenter reboot doesn’t fix the issue in your environment then disable HA and re-enable by going to properties of the cluster.