After they lost most of those same foreign investors that got tired of handing over their IP, the "local partnering" (what often resulted in state/court backed judgements against the foreign investors), ...
The disasters "wolf warrior" politics, combined with the above mentioned issues. And the stringent monetary policies limitation on moving money out of China did not help (translation: We want you to put money in, not being able to pull it out).
This has resulted in a reduction of foreign investment by almost 70% (given the 15 year average). What used to be easily be 200 a 250B investments per year, has now dropped to barely 100B, and is still declining.