Hi @Siddharth Nayak
Thank you for posting question to Microsoft Q&A Forum.
According to this issue, please follow this article to download Microsoft License Removal Tool then use to clear the existing credentials from your Mac then try to sign-in again.
If the issue still persists, please search for the application name "Terminal" and run this command:
defaults write com.microsoft.Word ResetOneAuthCreds -bool YES
You could replace Word with Excel, PowerPoint or Outlook based on the application you encountered this error message.
I hope this information is helpful, please let me know if you have any further questions.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.