Another view is that markets are not about gambling but rather investing? For example, index matched funds grow because the economy of the world, as a whole, is growing.
It's narrow index funds that are gambling. Not all index funds.
Even if you fail to do that as long as you have started investing sufficiently early enough - let's say 30 years before retirement (around 35 years old) - you probably have experienced at least one recession and recovery until retirement. If suddenly markets crash during retirement by 50% on an asset that is up by 150% does it matter? You still got away with a profit.
And nobody forces you to liquidate everything at once. So sure if you plan to draw out 4% of your stocks you will have decreased your portfolio by 8% every year.