F-35 was a success

The reason the F-35 was 'worth' the trouble is that it got over a dozen first-world militaries using the same combat system, rather than every nation trying to create less effective national champions. Aside from raising the standard, the distributed industrial base and procurement means that everyone involved- which is to say- American allies- can cross-train, cross-supply, and even loan/borrow/otherwise support eachother's air operations with minimal trouble, greatly increasing the self-reinforcing nature of the American alliance network. While- at the same time- ensuring that all participants are tied to the American logistic chain, meaning that anyone who wants to keep a world-leading aircraft operational won't go rogue against American interests.

The F35 is a political and logistical success as much as a technological success, and those are far harder to arrange at scale.