Each time an account is linked to the Windows installation, a registry entry is set, but it is not deleted when you link a new account to the Windows installation. This registry entry has to be removed by hand. To do so press the Windows key + R, type “regedit” and press enter. Here you have to navigate to HKEY_USERS -> $ID of your Windows User$ -> Software -> Microsoft -> Office -> 16.0 -> Common -> Identity -> Identities. In here you will find an entry with a seemingly random name. Search them all for an entry that contains the email address of your old Microsoft subscription account and delete it.
Most of the times after this the installation should work. Sometimes you also have to uninstall Office entirely and reinstall it.