Hello,
Is the code failing on all sign in attempts or only on your phone? This looks like an account verification issue, not the Outlook app, so try signing in from a browser and choose another verification option like a backup email or different number, and if no code arrives use the recovery form at https://account.live.com/acsr to restore access, once you regain access your emails will sync again and you can add the account back to your phone.