If the patent office can't do its job then how is the system supposed to work?
There are generally two legal fields related to patents - patent prosecution (getting the patent) and patent litigation (fighting in court). There is not very much overlap between the lawyers; each is very specialized.
People get patents for a lot of different reasons, only one of which is to hold up in court. If that’s what you want, you have to hire lawyers that will make that happen. It costs more money and takes more time, but if you want a patent that holds up in court you have to hire the right people to write it correctly, from the very beginning of the process.
Again, this is not what everyone wants. Most patents are intended to be for defensive, negotiation, or vanity purposes - the expense involved with making it bulletproof is just not worth it.