2. Following Chinese law includes following whatever arbitrary whims the party decides to enforce—including forced IP transfer.
The problem is that China's legislation and jurisdiction are in a complete control under a single political entity, CCP and its laws are deliberately designed to be ambiguous to allow arbitrary interpretation in favor of CCP. Also, don't forget that CCP's constitution is on top of PRC's constitution.
Obviously, this situation is not acceptable in the the principle of free trading as CCP is blatantly exploiting this political system to discriminate foreign companies and effectively violate the principle of national treatment. In order to join the global free trade system, a long time ago China promised to change its political and economical practice at least minimally compatible to other states. I think the previous presidents till Hu Jintao might keep it in their minds but unfortunately Xi Jinping doesn't seem so.
That's not to say that there are no legitimate complaints that foreign companies have, but the investment environment for foreign companies improved massively in China, and foreign companies have made huge returns on their investments. There's supposed to be a WTO mechanism for dealing with discrimination against foreign companies, though the Trump administration has put that mechanism out of action by blocking the appointment of judges to the WTO's appellate body.