>AFAIK, historically it has always ended up better to remain invested in the market.
It always has. Historically everything goes up. What everybody forgets in this scenario is what if a sizeable chunk of your liquid assets are tied up in investments during a crash and you're 5-10 years to retirement? You're seriously going to wait another 10 years for the market to correct itself to then cash out so you don't lose any money? No you might even be dead before you even have the chance to use it.