Well, whoever did that was proven right(from their standing point + Ukraine). Apparently you can't trust USA and give up your nukes. If you don't have nukes they don't honor the agreements and guarantees and even bomb you.
Unfortunately the American attitudes will result in proliferation. Not the Iranian ones.
Giving up nukes was never the intention. They would've slow-boiled the frog and we would one day wake up with a nuclear iran (with icmbs! - not banned under jpoa) if they were smart about it like dprk. Unfortunately for mullahs they weren't and got cocky and overextended. Then 10/7 happened and the rest is like they say history
Maybe or maybe not, we will never know that. Who knows how things play out when a country is integrated back in the international system and have something to lose when if get caught on checks. Maybe there would have been a book about how Iran continued its clandestine nuke program but eventually dismantled it as its society and economy normalized and having that had no benefits.
Now we know the timeline where agreements are not honored by the US.
Look, I don't know why you believe so much in the imaginary timeline but maybe Iran would have been like Israel: having the bomb and not talking about it.
Who knows, it's all speculation at this point. The current reality is that if you don't have a nuke you get invaded. Everyone will have nuke soon. Those who fail will be destroyed because agreements, international laws etc doesn't mean anything anymore.
Unfortunately the American attitudes will result in proliferation. Not the Iranian ones.