Could you give an example of laws that your friends found impossible to follow? If they don't speak Chinese, that would explain it, because obviously you first need to understand what the law says before you can comply.
Check https://www.chinalawblog.com/ for some examples if you want to.
Easy ones are:
You can be held criminally liable for mistakes your employer makes, since you have no control over and likely no knowledge of what "illegal" actions your employer might be taking, there is no way to comply with the law.
If you sell something to a Chinese company and they decide that they aren't satisfied with your product (maybe they just don't want to pay), you can be charged with a crime for selling "defective" products.
Your best bet is to keep your head down and follow common practices.
It is also important to read sources like https://www.chinalawblog.com if you want to survive in China long term.
However, I was never talking about this case in particular. I was talking about the assumption that if you just follow the law as written you'll be fine.
You have no individual rights while in China, and the law is intentionally vague and arbitrarily enforced. This isn't an accident--the system is designed so that anyone can be prosecuted if the government decides it's necessary. If you keep your head down and do what everyone else is doing, statistically you'll probably be fine. However, as a foreigner living in China, whether you break the law isn't up to you.
If a company decides they didn't like the product or service you provide and accuses you of selling defective goods, you can be criminally charged and convicted. If a Chinese citizen overcharges you and you don't want to pay, you can be criminally charged and convicted.
For high paid high tech workers this isn’t much of a problem, we got proper work permits, I think.
Work without authorization, get caught, get arrested and deported. Happens every day in countries all over the world. I don't see anything even remotely remarkable about this case.
In a country where millions of people are held in reeducation camps for practicing the wrong religion, the "law" as written is a joke.
From friends living their, it's impossible to actually strictly follow what's on the books, particularly for foreigners. You have to know the current expectations, what's being enforced by the local government etc...
What matters isn't what's written, it's what is currently being practiced.