Web OTP API read the OTP from sms message but return undefined

I have JS for getting OTP from sms message and autofill input on login.
The modal below open to allow or deny to read and enter the code from the sms, but when i allow it nothing happened.
While I debugged it on real mobile device I saw that the code break before the .then() function.
This is my JS code:

$(document).ready(function () { 
    if ('OTPCredential' in window) {
        try {
            navigator.credentials.get({ otp: { transport: ['sms'] } })
                .then((content) => {
                    // code not arrive here!
                    $('#my-otp-inp').val(content.code);
                })
                .catch((err) => {
                    console.error('Error fetching OTP:', err);
                });
        } catch (err) {
            console.error('Error initializing OTP retrieval:', err);
        }
    }
});

So, the code break before the .then() so I cannot set the OPT code in my input, and I didn’t get any console.log() message.

This is a screenshot of my site’s login:
enter image description here

What am I missing here?