If your Windows licence is based on a previous Windows 7 licence that is causing the activation errors.
A while ago Microsoft changed the licensing rules, after they made that change it is no longer possible to activate Windows 10 or 11 using a licence based on a free upgrade from Windows 7 or 8, they indicate the free upgrade licence dies with the original motherboard.