@PepeCZ as I said in my previous comment, I believe that would not be possible to achieve.
You see, TOTPs (the numeric codes) follow a standard that allows a 6-digit or 8-digit number to be generated. When you go to Microsoft's website and set up your 2FA, they give you 2 ways to do so:
Use the MS Authenticator app and its proprietary format, generating 8-digit TOTPs
Use a generic authenticator app, such as Google's, Enpass' and so on, generating 6-digit TOTPs
Going from 6-digit to 8-digit is fairly simple: you would just generate a URI (or QR Code for it) containing digit