One of the big issues with this is sequence of returns risk. If you retire and rely on your portfolio but the market dives for a year or two right after you leave the workforce, your total portfolio value is screwed because you were selling at a low point.
Which is why you keep 3-5 years of spending money in cash (or a bond ladder if you want to be fancy).
Tangentially: I think a lot of people forget/underestimate the degree to which the industries behind their job are ones that they need to diversify away-from.
In other words, a programmer should invest a bit more away from software than average, a realtor should invest a bit more away from properties than average, a coal-miner should invest a bit more away from energy and mining, etc.
If you have your job, you can weather a stock-downturn, and if investments are solid, you can weather a period of unemployment by liquidating some, but if both hit trouble simultaneously then that's much much worse.