Yes. That was an important argument for market economics as an aspect of capitalism. The originalt statement of this was in Mandeville’s Fable of the Bees or ‘Private Vices, Public Virtues’.
This was really based on self interest but even the vice of that, greed, could be beneficial in many cases. While Enlightenment thinking was much more diverse than many people realize, it did tend, as Voltaire famously notes, to assuming the best of all possible worlds. Modern economics inherited that and assumes each individual in a market system as a fully informed and completely rational actor.
It doesn’t take much now to see that as a fatal misunderstanding. That was very much what Marx was doing, though still limited by the assumptions of the age, and was finally taken apart systematically by Piketty in Capital in the 21st Century.
My own position is to build on the strengths of market economics while using big, dynamic data to monitor and manage in service and environmental areas that are not simple supply and demand. We also now have the emerging problem of the absence of scarcity that is the primary area of benefit in markets. In short if scarcity is not a factor a capitalist economy for a products or services they become monopolies in order to maintain or create scarcity.