Isn't the market always rational?

I always found the appeal to the market gods a bit odd. Why would the market fix mistakes instead of aggravating them?  When the Chicago economists sometimes (reluctantly) admit that people make mistakes, they claim that people make different types of mistakes that will eventually cancel each other out in the market. Behavioral economics argues that, instead, people will often make the same mistake, and the individual mistakes can aggregate in the market.  Let’s take the subprime mortgage crisis, which I think is a great example (but a very sad reality) of the market working to make the aggregation of mistakes worse.  It is not as if some people made one kind of mistake and others made another kind.  It was the fact that so many people made the same mistakes, and the market for these mistakes is what got us to where we are now.