So the real problem here is locally produced cars can't compete with China because China has slave labor all throughout its supply chain up to and including final assembly and manufacture. Do a bit of googling and you will find that byd got caught using slave labor to build cars.
This is oversimplifying the situation. It's not wrong, but it's also not the only reason. There are quite a mix.
The other reason is for a variety of deeply broken reasons, it's vastly more profitable to sell massive, oversized light trucks with poor safety, so that's all the indigenous car manufacturers make now.
The other thing is that China basically never had great combustion engine tech, and they just abandoned that route to focus R&D on upcoming electric drive trains, leapfrogging quite a few western manufacturers. The results are pretty good, by all accounts.
So as always it's a mix of reasons.Their execrable record on human rights certainly contributes, but with just that it wouldn't be enough.