When Russia invades Ukraine or Iran cuts the straight of Ormuz energy prize go up instantly, chocking the entire world economy in the course of a few weeks. Even if China stops exporting rare earths, it would take years before it affects the energy market.
It's absolutely incomparable.
Cuba is a good example by the way: a country can survive for decades while being cut from most technology import due to sanctions, but if you cut its access to oil, it becomes dirty real quick. And because Cuba has been stuck in the middle of the 20th century, it's actually much less dependent on energy than most developed or even developing countries.