The codes are being sent to the old phone. The normal process of moving to a new phone is backing it up. To resolve this:
For Work/school accounts you need to contact the admins of those accounts.
If it is a microsoft account contact Product Support with the email address for the affected user. https://azure.microsoft.com/en-us/support/create-ticket
You can mark it 'Accept Answer' and 'Upvote' if this helped you
Regards