There is a flaw of premise- a conceptual failing in the very conception of the system. Specifically, the idea that the economics of supply and demand will accurately represent the value of a product. Capitalism depends on this premise- at least, most interpretations do. There are several classes of product however, where this does not hold.
First, there are Cultural Products. Most books published to do not make back their publishing costs. Most independant art languishes in obscurity. There is no direct economic gain from Cultural Products- there is no economic advantage to revitalize an old building versus razing it and erecting a "Disposable Building"- a styrofoam and steel concoction that has a fixed lifespan of ten years before it needs to be torn down itself.
There is, however, a gain to these that would make a Randian cry. While capitalism ensures that we have an economy that works, it makes no provision to ensure that we have a culture left when we do it. Since there is no profit in restoring an old building, it should not be done- except that we do not want to surrender our history. There's no reason to produce art that makes no profit, that is not salable- except that it adds to the trove of history that defines our culture.
There is a corralary to this- and it is the same flaw that attacks reputation systems (at some point, expect an essay that's actually researched and not stream-of-consciousness) showing how capitalism is just a mature reputation system)- specifically, just because it's popular doesn't mean it's good. And the inverse- just because it's unpopular doesn't mean it's bad.
For example, someone writes a scathing critique of American Culture, Government and Economy, one in which they offend every group, from the conservatives to the liberals to the minorities and the monied. Every point they make, however, is well founded and raises an honest objection. While this book may not sell- it certainly should be read.
A less hypothetical version of this example would be the modern news media. The modern media writes what sells; they cover stories that sell ad time or newspapers, not stories of importance. Oh, there's crossover, but a story that offends- even one that is right to do so, exposing the hubris of the middle class for example, will not get covered.
There's more on this, but it's a good set of morning thoughts. Take them and mutate them as you need.