Please check where is the target mailbox is located - Exchange on-prem or Exchange Hybrid or Office 365 or MSA/Outlook?
The error is telling that the given mailbox you're trying to access is not enabled for REST API. You will see this error if the given mailbox is not located in M365. Also check with your administrator what other settings/environment changes happened.