In 2023 Microsoft blocked the use of Windows 7 product keys (and licence) from being able to activate Windows 10. This also affects Windows 11. (for the same reason)
Changing the hardware has prompted the activation server to check the original licence and hence it has been blocked. Windows 11 was never intended to be activated using an upgraded Windows 10 licence and only an original Windows 10 licence.
You will need to buy a new Windows 11 licence to activate Windows 11. Check the windows Store to purchase a supported licence.