Sanctions matter. In fact, Iran has been referring to the Vienna talks as sanction-lifting talks, rather than JCPOA-revival talks.
But it did not make the talks that lasted almost 18 months, a priority at any cost. It did its own thing while incarcerated by the US.
It looked East and struck deals with the UN-sanctioned club if you like, say in signing contracts and agreements with Russia and Venezuela. And we know our oil has been Asia-bound eastwards