The number of vCPUs and cores per socket are correctly configured, and CPU HotAdd is enabled.
Please refer : Virtual machine CPU and socket configuration
VMware vSphere 7.x
VMware vSphere 8.x
In cases where CPU cores appear offline within a VM, it is often related to issues within the Guest Operating System.
Investigate the Guest OS by reviewing the OS logs/events/settings to identify any underlying causes. Also check the last reboot time to determine whether the CPUs were online or offline prior to the restart.