There is rather a huge difference with a low unit cost assault rifle, which can be retooled or replaced with ease, and a modern fighter aircraft in general.
And the F35 is not in the middle lane of complexity of modern fighter aircrafts, it is leading the pack, both mechanically and electronically.
Further, the M16 core design was good (apart from the still present problem of direct gas actuation of the receiver bolt) and implementations details were the problem. The F35 is by design a compromise between competing demands. It is by design built, from the ground up, to not do any task well.
It has a body designed to accept the fan the Marines want to get sort-of VTOL capacity. This cripples it in other roles.
It has a half-baked stealth system, because of the fan and other trade-offs, and when in stealth it can't carry more load than an F15 rebuilt for stealth - an airplane costing much, much less in acquisition and operation.
And a pointy-nose in general is horrible for CAS. Almost no time over target, too little armor to go low and use direct fire weapons efficiently and too high speed to perform observation and guidance. The F35 solves none of those problems, except the speed one in the Marine version, but that plane is even more fragile than the non-fan version making it terrible for a CAS role.
There is no way to change that downstream on aircraft which are already built. The F35 will cripple US air capability, not directly because of its own problems directly, but because it removes aircraft more suited for the roles due to eating up their budget.