Although you can purchase Microsoft Office 2021 from the Apple Online Store, and in that case, a license key for Office should have been sent to you via email, Apple does not otherwise preinstall any Microsoft software with the operating system on new or refurbished Apple products. An Apple reseller may do so, and in turn, they need to convey the license key to you as well. If you purchased this iMac from a reseller, and they did preinstall MS Office, you need to get the license key from them.
Apple is not responsible for Microsoft product or licensing issues, and rightly told you to contact Microsoft for further resolution. Call Microsoft again, and escalate this issue if necessary to a satisfactory resolution.
The Apple Support communities does not incorporate a pseudo-Terminal in the website. I am typing this on a purpose-built editor for submitting posts and it does not prompt for any password.