It's a bait and switch. Get foreign investors to build companies in your country. Let them pay for training. Children can now go to school and university. They become adults and gain experience during their job. They now want to leave the country for higher incomes (jackpot). Then finally give them a reason to stay. The Chinese government has amassed an insane amount of money and growth during their business friendly periods and is now able to deploy it for protectionist measures.
The reason why protectionism is a bad idea is that it's commonly used in incompetent governments that are prone to corruption before the country is ready. They instate the protectionism before the country has formed a competitive industry. The end result is that consumers have to pay hefty tariffs on foreign products that are almost impossible to replicate domestically like GPUs or CPUs. Alternatively consumers are stuck with inferior domestic products because there is no reason for the domestic monopoly to improve without competition.
Saying this, you need to mention just how fast they burn that money.
I once did a contract for a company that participated in a $1.9B OBOR project, where $600M managed to vanish into thin air, $150M was outright stolen, and the remaining $1B never materialised.
The procurator office of the country managed so far to recover $460M from all over the world from the missing $600M.
The most shocking out of the whole story was how the Chinese side reacted. Their stance was like "You "lost" $600M, and so what? We have more"....
Mind you they are making a profit, not running a charity
Nothing is black and white.
Domestic markets were kept relatively closed in order to foster development of local industry and companies.
Even without their will to control information for political purposes they would have not allowed such a key industry to be controlled by foreign players, and they have a strategy of creating a strong national industry in all sectors.
Is it simply that The Coca Cola Company and PepsiCo have better lobbying than Google/Amazon?
India's present economic strengths and growth opportunities are in its ability to carry out work in the English language and IT sector for a wealthier multinational market: it's not a good bet especially not in the short run to sacrifice those opportunities to try to get Indians to mainly use Indian manufactures. Which is also why you have Google India and Amazon India. China didn't really have that same level of opportunity even if they'd pursued complete economic openness that's entirely alien to their political culture. And most countries smaller than China have been highly selective about which industries and resources they protect and for good reason.