US duking out with Iran in the middle east is also in China's interest. I think China cares less and less about the western sanctions on Iran now, given the irreversible decoupling of the global financial system (fall of the USD hegemony). Ultimately it is in China's interest that Iran doesn't get nuclear weapons, weather an agreement is made between Iran and the west doesn't really concern China anymore.
Iran threatening to strike is much more valuable than actually engaging in war. Currently, the threat of an attack means that there's no aircraft carriers in the Pacific. In a similar situation 5 years in the future, this might be a perfect time to strike Taiwan.
If there were a major war, the US wouldn't attempt to occupy Iran, which would cost them more than Iraq and they might not even be able to do it very quickly without a neighbouring country with a land border like in desert storm. Instead they'd do only airstrikes, similar to the destruction of Libya. Libya is the worst possibility for China. A champion of the global south destroyed at minimal cost to the west. The current situation with Russia, Iran and North Korea combining their military industries to bleed the west is really ideal.
If the west is willing to allow Iran's economy to strengthen in exchange for reducing nuclear material, that will translate into more drones and missiles sold to Russia or pointing at Israel