China's claim on Taiwan is based on the principle that it is legally still Chinese territory. Crimea is still legally Ukrainian territory, so Russia's annexation is a real problem for China. They can't support it because that would undermine the basis of their claim on Taiwan. Similarly with the invasion of Ukraine, any principle China could use to support Russian's military intervention in Ukraine could also be used to justify US military intervention in Taiwan.
On the other hand big countries muscling in on little countries to take their stuff is a hobby China would love to take up if they get the chance. However their domestic promotion of Russian propaganda is more about the fact that they hate the west than it is about them actually supporting Russia at all.
The legal details are of lesser importance I think.