The only reason they say not to fly close to your due date is just in case you go into labor while in the air. No one wants to give birth on a plane lol
If you’re not high risk, the perfect time to fly is in your second trimester. I flew in my first (before I knew I was pregnant) and in my second at 25/26 weeks