First is to make sure Windows is up to date. Then remove their info:
- From Start, type credential manager, and then select Credential Manager from the search results.
- Select Windows credentials.
- If there are any credentials for MicrosoftOffice16, select the arrow next to them and then select Remove.
- Close Credential Manager.
- From Start, select Settings (the gear icon) > Accounts > Access work or school.
- If the account you use to sign in to office.com is listed there, but it isn’t the account you use to sign in to Windows, select it, and then select Disconnect.
- Restart the device and try to activate Microsoft 365 again.
Got to this link for more suggestion:
https://learn.microsoft.com/en-us/office/troubleshoot/activation/tpm-malfunctioned