The Marxist theory that capitalism will fail because it cannot get a return on its investment ( in production and manufacturing), seems logical but is not actually what is taking place now.
Mass production always tries to eliminate labor. Production without labor was an entirely alien concept to Marx. Now it is a reality. We have robots eliminating factor workers. Computers have eliminated millions of jobs. Now AI will start to eliminate more high paying jobs. Socialism is impossible without a worker's revolt. If there are no workers, there can be no revolt. Your capitalist overlords have planned to put you out of work so there can be no rebellion.
The future will never be 'socialist'. More than likely it will be techofeudalism.