No hand crafted programs where not 'better' and I am not saying that we can ignore and not use AI, I am saying that knowing what you are actually producing and how it will run on a system and knowing what are the right things to want are better then someone who producing a program that does everything they want but what they wanted was bad, insecure (by design), poorly thought out and scales badly (in terms of adding new features).
AI can produce good code, good enough code and build excellent scripts and wrangle tools like socat, but leaving it on it's own and just asking make me a web app that does X. Further how many bright ideas will come to the users mind when they get excited for example "actually I don't like the way this database works each user should have a table, I think that would be better and easier to work with and look better as I can just inspect a user like a report!", time will tell but users of AI to vibe code apps who will be liberated from the details of how will not question their why's.
We don't need a fault-free method of producing software to realize that any levers used in the process can only amplify errors and their consequences. Sometimes the answer is to go slower and make it correct before pouring wattage on the system. Sometimes the answer is go go fast and break things.
The only certainty should be that there is no universally correct answer to how to seek answers. Sometimes an ad hoc app built quickly without looking at code is the best solution. It certainly shouldn't be a surprise that any gains therein are not without cost. Or that any such machinery can only ever make knowledgeable people doing slow work on fundamentals more necessary, not less.
Given all the AI discovered vulnerabilities that's been cropping up, were handcrafted programs really that much better?