Hello,
More information would be ideal to detect which issue is exactly responsible for this error. I would recommend to check for Error events in the Application Event viewer, and check for source: Microsoft-Windows-Security-SPP this would provide a 0x... error code that will help to identify it.
But, first recommendations:
-Ensure that you open CMD with administrator privileges
-Check the Software Protection Service status, set start as Automatic, and check Log In account through services.msc
-Run slmgr.vbs /dli to review to current licensing status and see if there is any relevant error or information
-Try to remove the licensing data, and add manually using:
slmgr.vbs /upk
and
slmgr.vbs /ipk <productkey>
--If the reply is helpful, please Upvote and Accept as answer--