Seems you need a "trusted" phone number in order to get a verification code. You.may be able to make a change
To see, add or change your trusted phone numbers
✽. On your iPhone, iPad or iPod touch:
Go to Settings > your name > Password & Security. Next to Trusted Phone Number, tap Edit.
__________________________________________________________
Else: Wondering if Apple support's online articles (links below) can help:
If you haven't already: Check that you are signed in to the iPhone with your correct Apple ID:
Sign in to your Apple Account on the web or in your device settings - Apple Support
See how to: Get a verification code and sign in with two-factor authentication - Apple Support
More info: Two-factor authentication for Apple Account - Apple Support