Buy the planes with spare parts and training. When calculating a price for a plane, include not just the price tag, but also the risks of getting these planes unusable in ten years.
So yes, buying jets from China might be not the best idea even if they initially seem cheaper. But that’s not the case for US jets.
Maintaining a Sovereign Nation 101 is that you do not entrust your national security to another country. Sure, it's more expensive to do your own R&D and manufacturing, but you get the peace of mind that your continued existence does not depend on a foreign government's continual blessing.
Why? It's hard to predict how relationships with the US will look over the next 40 years (F-18 is 37 years old). Especially with relationships on a downward trajectory during Bush's and Trump's presidency.
Sure, the risk is a lot smaller than with China, but it does exist
Suppose you buy fighter jets from China, but tensions rise and you somehow cut diplomatic ties. How are you going to get maintenance parts. Very inaccurate example but just to illustrate that yes, economically, your idea makes sense. Geopolitically, it depends.