Based on: Get a verification code and sign in with two-factor authentication - Apple Support
A code is sent first to your trusted devices (some other Apple computer or Apple mobile device signed in with your account) automatically. If you have a trusted device running iOS 9 and later, OS X El Capitan and later, iPadOS 13 and later, or watchOS 6 and later, the verification code is displayed automatically on your trusted devices.
It is a good idea to have more than one mobile number.
If you had set up a recovery contact, read Help a friend or family member as their account recovery contact - Apple Support
If you see. “Verification codes cannot be sent to this phone number at this time. Please try again later,”:
1) Wait a few hours and try again. Maybe it really does mean not at this particular time.
2) Use this link to check the status of Apple’s various services and servers —>
Apple - Support - System Status
3) Disable entirely any VPN you are using.
4) Try clicking on, “Cannot use this number?”
If you can’t sign in, reset your password, or receive verification codes, you can request account recovery to regain access to your account [ How to use account recovery when you can’t reset your Apple Account password - Apple Support ]. Account recovery might take a few days or longer, depending on the specific account information you can provide to verify your identity.