On CloudLinux 8 servers, WHM -> Security Advisor cannot list services that need to be restarted due to unexpected output. You will not be able to get a list of services that should be restarted through the UI.
The needs-restarting binary on CloudLinux 8 servers has an additional output that says, "This system is receiving updates from the CloudLinux Network," which was not output in previous releases. Since cPanel does not expect this output, the Security Advisor section for this is unsure how to proceed and exit.
We do have an open case with our developers regarding this. The internal case number is CPANEL-41910. Please click on "Follow" in the top right of this page to be notified when this case has been patched and a fix released.
You can still run the /usr/bin/needs-restarting command from root SSH to get a list of services.