On CloudLinux 8 servers, WHM -> Security Advisor is unable to 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 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 exits.
We do have an open case with out developers regarding this. The internal case number is CPANEL-37859. 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.