In particularly, they patched together their prototype in a way which all hackers will appreciate.
https://www.youtube.com/watch?v=RQ5gmZ74YBY
Here's Jon Beesley, the pilot who did first flight in the F-35, along with quite a bit of the early air worthiness work. He is discussing the weight reduction efforts associated with what was called SWAT, STOVL Weight ATtack.
Originally the three F-35 variants were supposed to have about 75% of their structures as either common (identical) or "cousin" (largely the same but with some minor differences) parts. In other words, the F-35 was supposed to be modular. Unfortunately, this made all three variants overweight. This matters most for the F-35B, where extra airframe weight directly reduces bring-back weight and cuts into the performance margins of STOVL flight.
Starting at 2:15, he discusses the modularity issue directly (with a bonus discussion on scope creep!) "Holes are really heavy." For every hole, you must have a more robust structure around that hole to maintain overall structural integrity. A modular aircraft meant a heavier aircraft, so heavy that the F-35 was in great danger of being too heavy, missing a key performance parameter for the contract. Eliminating the modularity was the way to make the F-35 meet this performance parameter.
It's all about engineering tradeoffs.
I bet most of the avionics that get adapted for a new plane require some modification to get them working. This is, IMO, much easier if you start from a working version.
Consider the semi-disaster that is JTRS[1] (basically the f-35 of software defined radios). It was designed to be modular, and that was part of the failure. If they had picked a single form-factor that was useful in isolation, that would have allowed a single system to get up and running, and then it would make sense to grow it out from there, reusing where it made sense to.
Instead there was this byzantine connection of interdependencies and parallel development with few integration points that seemed likely to doom it.
1: https://en.wikipedia.org/wiki/Joint_Tactical_Radio_System#Pr...
Lots of standard interchangeable parts that can be individually replaced rather than one "do-it-all" pile of dependencies.
McDonnell-Douglas significantly upgraded the YF-17 mission systems and cockpit avionics for the F/A-18A/B and it was more advanced than the F-16A version at the time.
The F-117A basically used the same mission avionics and engines as the F/A-18 which was a few years ahead in development.
Having inter-service commonality in major systems and components sometimes a better option than a joint aircraft program. The USAF is upgrading the F-15C (& some export customers) with AN/APG-82 radar, which is basically a larger AESA "antenna" on a AN/APG-79 radar from a Super Hornet.