Maybe you are right. But I am not so sure. Given the mess they are in they would like to save all their resources for themselves, to improve their economy instead of investing it in foreign countries. Also size of their purse is going to decrease. Already tens of millions have lost job in China due to stoppage of exports. In next five years, these sanctions will only increase hence decreasing the fiscal space for CCP.They are sitting on a large cash pile which they want to invest. The worse their own economy performs, the more they need access to foreign markets. And when it comes to Iran, it is also about oil security.
$400B over 5 years is not a lot of money to China. It's merely $80B a year, and pretty much most of it will be profitable.
Also there are other factors which could sabotage this deal like pressure from India and US. Threat of regime change as local population is not in much favour of these deals. But as these factors are not directly related to Chinese financial situation hence we could ignore them in present discussion.