By default, during a host failure, affinity rules are considered during failover. For example, if two virtual machiens have a VM-VM anti-affinity rule and one virtual machine fails over, they will start on separate hosts. If the affinity rules cannot be satisfied, the virtual machine will not be failed over.
If the vCenter Server Appliance becomes unreachable during a host failure, failover occurs without considering affinity rules.
VMware vCenter Server 7.x
VMware vCenter Server 8.x
This is expected behavior. During failover, vSphere HA queries vCenter Server to determine the optimal placement of virtual machines. vCenter Server then provides vSphere HA with a target host that satisfies the affinity rules. If vCenter Server is unavailable, vSphere HA uses the Simple Placement Engine (SPE) to fail over the virtual machines.
If you have modified vSphere HA advanced options such as das.respectVmVmAntiAffinityRules, vSphere HA may behave differently from what is explained in this article. For details on vSphere HA advanced options, see: vSphere HA Advanced Options