When people talk about AI, they don't talk realistically, they talk theoretically. Just look at trains. New York City subways have been trying to modernize their switching system for 25 years. Estimates show as long as 50 more years just to finish upgrading existing tracks. Are the people that are upgrading the track going to get replaced before then? Not likely.
Even if all practical common sense is thrown aside and you imagine a Jetsons world where robots have taken over most jobs, there will be new jobs, because we will have new industries built on top of the automated ones. We just invent new jobs, the same way we invented them for a technology industry that did not even remotely exist 50 years ago.
All of this AI hype also depends on the status quo, and in all likelihood our society won't even be remotely the same in 40 years. Estimations like these depend on the US maintaining its hegemonic dominance over global trade. How the hell is it going to do that if its deficit grows exponentially and it can barely fund its federal budget every few months? Is Silicon Valley going to keep pumping out new technology once the unlimited tap of VC money dries up? Can the industry withstand a collapse of the current regime of super-consolidated monopolies? Will bare-bones politics end up poisoning and strip-mining the land we currently overburden for a few genetically modified crops, reducing economic output to fracking protected wilderness for oil and gas and white collar work in a paltry few cities on the coasts?
Who knows, but assuming robots will take all our jobs in 40 years sounds like extremely magical thinking.