1. Forensics difficulty. You need extensive data to debug issues for complex systems. You can collect so much more data from terrestrial testing, which allows you to do the extensive forensic analysis required to achieve the required component reliability. Once you put a telescope in space, you can't inspect it anymore. A lot of the sensitive components which might fail on JWST have to be inspected to microscopic precision in order to perform adequate failure analysis.
2. Design requirements are far, far more precise. Many failures in deep space are effectively impossible to correct in later iterations due to point 1. Telemetry and sensor data is enough to debug rockets, but for JWST you would need to ship so much extra data/sensor infrastructure alongside the telescope that the whole project becomes recursively intractable.
The system complexity is so high that you absolutely must have the ability to make arbitrary system corrections because the chance of "building everything correctly the first time" is effectively zero, even with perfect hindsight! Essentially, any time you build the thing from scratch, you will always find mission-ending statistical deviations. The objective of on-ground testing is to identify and correct those specific deviations, until the whole system is within design tolerances. If you were to totally rebuild it, the next iteration will have a totally different set of statistical deviations which will need to be corrected. This process of development involves "hardening" the entire system through extensive testing, because it impossible to build a fully-hardened system to start with, even after "learning" from previous attempts.
Instead of sending up 1 super precise super accurate super reliable telescope let's send up 1000 mostly POS telescopes and combine the results using AI of the 900 which actually make it to orbit and return useful images.
I'm hardly saying that's a 100% working plan, but, I think that kind of paradigm shift which is required.
Kind of like in computing, where we moved from a single ultra reliable mainframe to tens of commodity hardware.
Commercial software development practices might be relevant where you can fix things overnight, but this is hard science instrumentation made of atoms, you ship things that must work as expected because the whole point of all this is making better measurements as the field evolves and there's a scientific case for doing it. It is not about selling production versions of the experiment to potential customers.