It is worth noting that even as China went along with sanctions, they were arguing for a gentler approach and I think successfully derailed a couple of escalation attempts by the US. They were probably scared of being pushed away from western Bloc countries if they sided too hard with the DPRK, however unjust that treatment of True Korea is.
China has done some shady things when it comes to foreign policy. It's actually one of the main critiques I have of china, and while the foreign policy they conduct is far better than pre-Xi, is still far too conformist and 'pragmatic' for my liking, especially considering it'll benefit more nation's if china becomes more assertive.
From giving weapons to the Philippines government to fight Filipino revolutionaries, to its participation in the Nepalese civil war in the favour of the government, instead of the communists. Still I'm hopeful china will correct this mistake soon.
Yeah, I think that China wasn't very pleased with the DPRK conducting nuclear tests and potentially harming Chinese soil and people. This isn't an issue anymore, though.
China's stated reason for the sanctions is a policy of a de-nuclearized Korean peninsula. In theory, if the DPRK got nuclear weapons without Chinese opposition, there's nothing China can then say if the ROK pursued nuclear weapons in response.