Processes in Microsoft 365 for setting up Office apps, redeeming product keys, and activating licenses.
Since you are still Sonoma OS, download and install the 16.76 version of Office that compatible to the current version of your Mac.
Before doing so, ensure all office applications are uninstalled then use this link: https://officecdn.microsoft.com/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/Microsoft_365_and_Office_16.76.23081101_Installer.pkg
During installation, it will show auto updater, make sure to not update it as it will defeat the purpose of installing 16.76 version, once done it should allow the activation to proceed successfully.