Trained security experts can't see everything in thousands of lines of code
This is relevant to the discussion at hand how?
One of only a couple you could reasonably be implying is that large pieces of software have multiple security flaws in their implementation, leading to potential zero-day exploits.
This is simply not the case in a manner which leads to widespread security problems - there are plenty of security solutions which are considered extremely secure, and have been released in a fully publicly available fashion for years, without any exploits being revealed.
As a hacker, why bother investing the time looking for zero-day exploits when you can assured that there are stupid security departments open to year-old exploits or social engineering attacks instead? Hence why a very small minority of actual security breaches are from zero-day exploits. Take a look at some high-profile security breaches - the vast majority of them are occurring because of shoddy security practices, bordering on negligent for any competent professional.
Or maybe you're trying to imply that custom-built web-facing software is vulnerable, because the code authors can make mistakes with the code?
If so, that is exactly what I'm talking about; that is the fault of the organization for hiring incompetent staff. There is a ton of free open-source software reviewed by thousands of people which meets every security need around, or you can go for proprietary non-free solutions, where someone else takes on the liability for security breaches. If you actually decide you need a custom-built solution, you need to budget enough to hire enough competent staff to do it properly.