There are two key differences between rockets and space telescopes (any space-faring probe, really) which prohibits "iterate to failure" as a development technique:
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.