The market is certainly not perfect. There is waste, bad investment, etc. There's no avoiding that. Unlike government, however, the market is much more efficient in realizing and correcting for that.
This empirical mismatch is either handled by engaging in no-true-scotsman support for the dogma, or engaging