Adding answer from comment section for more visibility.
Fixed the error by logging into my demo tenant's M365 account by clicking somewhere near the highlighted text in the following screenshot (I think there's a login button that appears when you over it with the mouse cursor).
Thanks,
Nivedipa
If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.