3 decades ago, it was technologically not viable. but today, it is. and China is just lucky enough to have this right time to do so.
There is nothing about time. Technology is progress curve. We still know nothing about many aspects to replace humans with robots.
Heck, we are way way way off creating a machine that can replace humans. And even, if it replaces humans in certain fields it will just increase productivity.
Lets look 500 years back. Everyone was engaged in Agriculture. Today, the population is MANY TIMES more. Yet, Agriculture with right technology and industrial policies needs very less labor.
What happened?
Humans moved to higher skilled things, where they were able to extract more out of themselves.
So keep yourselves at 500 years back, where all jobs were in Agriculture, and suppose China was having the same problem then. Would you have recommended them to halve their population, that of 500 years back, since Agriculture will be taken care by technology anyways?
Similarly, there will come a time when robot may be able to cook, or perhaps do more mundane stuff in the next 50 years, but then the race among nations will move to higher skilled things. The proportion of engineers, scientists will exponentially increase. You don't want to have less humans at that stage.