The same thing happens in welfare economics. In Pigou's seminal The Economics of Welfare, he describes many situations in which markets fail to achieve the optimal outcome. One example is congestion on roads. Marginal cost pricing would yield the optimal amount of congestion on the roads, yet marginal cost pricing is not used, QED. Not long after, in 1924, Frank Knight showed that Pigou was missing a critical piece to his argument: the cause of the supposed inefficiency. Here is Knight, page 12 of the pdf:
Professor Pigou's logic in regard to the roads is, as logic, quite unexceptionable. Its weakness is one frequently met with in economic theorizing, namely that the assumptions diverge in essential respects from the facts of real economic situations. The most essential feature of competitive conditions is reversed, the feature namely, of the private ownership of the factors practically significant for production. If the roads are assumed to be subject to private appropriation and exploitation, precisely the ideal situation which would be established by the imaginary [Pigovian] tax will be brought about through the operation of ordinary economic motives.Knight goes on to explain in detail how the roads would achieve the optimal pricing system under private ownership and competition. Pigou didn't describe inefficiency. He observed the consequences of a missing piece of a well-functioning economic system, namely private ownership.
By and large Knight's argument was ignored. Then, 40 years later after The Economics of Welfare, Ronald Coase gave a more general version of the same argument, that Pigou failed to see that so-called externalities are caused by the deliberate decision to create and tolerate them because the alternative is too costly, specifically because of transaction costs. Internalizing the externalities, whatever that means, would not be Pareto improving due to the additional constraints Pigou was unaware of.
Knight and Coase were geniuses, but every economist should have wondered the same. By definition inefficiency means that there is some feasible way to make everyone better off. The question is why they don't take that feasible, improving alternative. Pigou's explanation, and the explanation the economics profession has accepted, is that of inefficiency or market failure, which is no explanation at all. They shrug their shoulders, announce that someone or something "failed" (who failed? Why did they fail?), and talk about the optimal Pigovian tax. In the Pigovian system externalities and inefficiency are acausal. They happen, we accept that, and move on.
Asking why of the Pigovian system is fatal to it. There can only be two answers to the question of why inefficiency exists:
1. The Pareto improvement is not feasible.
2. The Pareto improvement is not a Pareto improvement.
Both these answers resolve the confusion of why people aren't taking the opportunity to make themselves better off. They also resolve the inefficiency itself.
Treating economic phenomena as acausal yields the opposite conclusions of treating the same phenomena as causal. Personally, I think the latter method is the way to go.