Dear JB Faria,
Good day! Thank you for posting to Microsoft Community. We are happy to help you.
According to your description, you need to make sure the date and time on the device are correct and syncing automatically. If the date and time are wrong or out of sync, the code won't work. You can also try clearing your browser's cache and check if the problem persists.
If the error persists, your MFA (Multi-Factor Authentication) may need to be reset. For your reference: Set up multifactor authentication for Microsoft 365
Besides If you need more further help , since your problem involves MFA, but we are focused on technical support for Microsoft 365 Business Exchange Online, which is not professional for your question, I recommend that you ask questions (based on) in Microsoft Q&A and using this tag( azure-ad-multi-factor-authentication) ,Technical engineers over there specialize in MFA issues, and experts will focus on queries to further assist you.
Your patience and cooperation will be highly appreciated. Hope you all the best!
Sincerely,
Kerry Chen | Microsoft Community Moderator
***Note: In the event that you're unable to reply to this thread, please ensure that your Email address is verified in the Community Website by clicking on Your Account Name > "My Profile" > "Edit Profile" > Add your Email Address > tick "Receive email notifications" checkbox > click on "Save".***