In short, your whole thought is based on the assumption that North Korean wanted China's protection agasint US aggression, but China refused, so NK developed nukes, then China complies to US sanction on NK to stop the nukes.
That is totally opposite to the truth. Do you know that Kim il song purged his colleagues who had deep histories with both Soviet Union and China in the early time of NK? Is that the fault of China and USSR/Russia of not providing protection? Being a Chinese vessel state for over a thousand years made Kim extremely sensitive not to make NK once again a vessel state, either Soviet or China. If NK really wanted China's protection like you assumed, why didn't Kim ask PVA to stay and pay for it like SK did to US? According to you, it was China's fault that NK asked China to leave and facing the US and SK alone?
You also assume that China's joining sanction is only to please the US. On the contrary, from China's perspective, so long as SK and Japan not having nukes, NK should not have either, this isn't related with Sino-US relationship.
You seem to have the mind that anything anti-US is automatically good for China, it isn't. China's agenda is to be the number one, many of that agenda is at odd with US, but far from all. Many regional powers' anti-US agenda isn't pro-China either, they are for themselvs which is not necessrarily in line with China.