How much of the current situation is a result of that previous deal?
The deal basically stopped iran's nuclear program but allowed the regime to better send money and guns to its proxy network.
The current war is effectively the downstream consequences of Iran's proxy network going off the leash.
Ultimately, negotiations work best with both a carrot and a stick. If its just a carrot, and no deal would be unacceptable to one of the parties, then the logical thing for the other party would be to always hold out.
----
In any case, in this specific situation (regardless of how we got here), its hard to imagine that Iran could have made a deal and survived. The regime is very weak at home and its questionable if they could have survived the loss of face to agree to what usa wanted.