I have thought about the same thing. If one assumes such an outcome then what follows IMO is communism and then one world communism. A “1984” type deal. There will be a remnant of rebellious souls like us around clashing with the “machine”.
I think a UBI, if done properly, along with other social works could be enough to head off communism and just has a quasi socialist state where private ownership provides a basic level of living. It will be a long, long time before the world could afford a UBI - if ever - so I think you’ll see nations eventually be forced to close their borders.