In many senses there's hubris in the western* view of China accomplishments: most of what western companies have created has had significant contribution by Chinese scientists or manufacturing, without which those companies would have nothing. If you look at the names of AI researchers there's a strong pattern even if some are currently plying their trade in the west.
---
* I hate the term "western" because some "westeners" use it to separated what they think are "civilized" from "uncivilized", hence for them LATAM is not "western" even though everything about LATAM countries is western.
It’s notable that China did not adopt the same policy during the period you are associating with their rise. Indeed, they’ve taken the opposite stance in recent years and (now that they have stolen American IP) have moved to seize control of assets and expel the superfluous foreigners.
There is a lesson to be learned there, but it’s contrary to the argument you are trying to make.