That happened at a time when China's relations with the west were on the rise. Today they're on the decline and the west needs China as much as China needs the west for business purposes. The west doesn't have the same kind of leverage that they once had over China or Russia. At the same time, in recent years, especially recently, the west has shown alot of animosity towards Russia and China, specifically China's activities in Xinjiang and Hong Kong.
Iranians have learned their lessons from previous mistakes. I don't think Iran will give any nation a penny unless they receive the military hardware first or perhaps meet somewhere in the middle. This is not Iran's fault but rather a necessary measure Iran must use to ensure it doesn't get screwed over again. At the same time China is not South Korea and are not subservient to the Americans every whim. Realistically though the only way Iran will be able to make a purchase from Russia or China work is for the purchase to be significant enough to ensure it doesn't get sabotaged by Iran's adversaries.
Let's say for example Iran purchases 100+ fighter jets from Russia, along with hundreds of tank engines, tank cannons, air defense units, along with helicopter parts and other components. Such a deal would be extremely lucrative for Russia and their military is already being sanctioned and they need the funding to build weapons like the Armata or SU-57, so realistically what is the west going to threaten them with ? What is Saudi Arabia or Israel going to offer them in exchange for cancelling the deal ? Realistically this is not Iran's fault.
Logically if you're going to sanction several nations at the same time, of course those nations are going to work together to defy you. The sanctions vs Iran were extremely effective during the Obama era when Russia, China and the rest were on board. Today things have changed. Right now China is purchasing 1 million barrels a day from Iran. That's what they're openly admitting. If the US/EU wanted to prevent Iran from purchasing advanced military hardware then they really screwed up their chances because right now it seems like all of the pieces have fallen into place for Iran to make major purchases in the next few years.