Note that there are 20 year periods where the net gain is close to 0. People starting their economically productive life during one of those intervals will not see any economic gains from investing in the stock market, and to the extent that the market echoes the economy their economic situation will likewise be stagnant. And worse, there will be all the people from the lucky intervals extorting these unluckly people to pick themselves up by their bootstraps.
People born in the lucky periods almost always describe their results as due to hard work, never as due to luck. And unlucky timing is almost always attributed to personal failures, not the economic situation.