Hi,
Could you please add checking for the following registry key:
HKLM:Software\Microsoft\ServerManager, CurrentRebootAttempts
As per https://docs.microsoft.com/en-us/sccm/core/servers/deploy/install/list-of-prerequisite-checks#pending-system-restart
Thanks,
Will