Happened to me quite often. Do you have your facebook running on another phone or computer? If you have it working on another pc, when you logging from another device, you will get a notification on the platform where your Facebook is already open. The notification will ask if it was you trying to log in through a new device in which you should say yes, and it will give you the option to recognize the new device. After that, on the device you wanted to access your Facebook from, just go back to log in screen and enter your credentials and you won't need the code.
If your Facebook is opened on another phone through the app, all you have to do is to go to the settings, then code generator, and you will find the code to log in through your new devices.
Another reason why you didn't receive the code to your new phone is probably that the phone number is different from the one you registered on your Facebook.