When changing from Office 365 to Office 2021, one should install Office 2021 and you will get an “invalid product key” message, the problem might be that you already have Microsoft 365 or an Microsoft 365 Trial installed.
Upgrade recommendations
Make sure your computer meets the system requirements for the newest version of Office.
Run the Microsoft Office Setup program on a computer with an earlier version of Office installed.
If you uninstall office before installing the new version, your Office files will not be deleted.