I don't think that it's actually illegal, just that developers play it super ultra safe with the Chinese market.
It's not that hard to get banned, they just banned tens of thousands of games on the Apple store a while back.
It's the same with sexualized content too, Chinese games are way more sexualized than Western games but it gets censored constantly for the Chinese market.
Funnily enough the same happens in Korea too with Western games.
Even Overwatch gets a '' changes recommended '' pretty much every single Blizzard game did.
Blizzard outsourced Warcraft 3 Reforged to a Chinese studio and they didn't really censor the designs outside of basically turning the skeletons into Zombies.
Diablo Immortal is going to have the Necromancer too and that game is very specifically created for the Chinese market and they did the same there.