Hi ,
In this case, try activating it after the hardware change.
Explained in the link below:https://support.microsoft.com/en-us/windows/reactivating-windows-after-a-hardware-change-2c0e962a-f04c-145b-6ead-fb3fc72b6665
If you purchased the digital license separately through the Microsoft Store or from Microsoft itself.
Remember, if you are trying to use a license from a computer that came already activated with Windows Pro and is using the same OEM license, you cannot transfer an OEM license from one computer to another because this license is tied to the PC's hardware.
If it's a 25-digit physical license, you would have to change the product key.
Make sure you installed the correct version, whether Home or Pro, that you purchased.
Give feedback if the information was useful or not.
Thanks