Consider, let's say, manufacturing. We have pretty much nailed down the details of how to automate a factory. Still, we do not see that the world manufacturing has been dominated by the most technologically advanced countries. When you automate, you have to pay upfront for your robots (with a ROI measured in years). With human operators, you defer payment until after you have collected the benefits of their labor (in terms of finished product inventory, not revenue). Not that it has not been tried, car companies tried to pull it off in the 70's, because in the books it looks like the robot is an asset, while the payroll is a liability. But they all discovered the hard way that cash is king and have been struggling with imminent bankruptcy ever since.
Instead, the big powerhouses are less advanced countries with large pools of young workers and weak labor laws. There a manufacturer can get started with much less capital and pay as it goes, instead of building these huge, high-maintenance, illiquid capital investments. And when the market shifts (and it always does) they can retool an pivot much faster too.
Apply the same logic to economic activities where bussiness processes are not throughly documented or even understood (like crafts and professions), or those which depend on contingent uncontrollable factors (like agriculture), and you will see that the idea of a fully automated society is beyond human reach.
Maybe if we manage to build a super-intelligence to solve all these problems for us, we may have a chance, or maybe there are fundamental limits that just cannot be overcome. But in either case, as of today, I think this is more science-fiction than actual science.
I agree that not all workers will end up being programmers, but a shift towards automation is inevitable as routine human labor will eventually be too costly and inefficient, regardless of the location. China is already starting to show signs of rising labor costs due to an improving economy and a shortage of labor. I would bet against human labor in the long run, as counting on lax labor laws and a population of workers who are willing to tolerate abject poverty as a method for keeping production costs down seems like an unsustainable solution.