Considering that North Korea is far more isolated, maligned, authoritarian, negatively portrayed, 1/3 of Iran in population about 1/15 in area, and 1/100 or less in natural resources, North Korean achievement so far has surpassed Iran in most definitive terms. North Koreans do not need to go to the West to sign JCPOA and hand over their nuclear materials, allow IAEA inspectors in and accede to other Western intrusive demands that transgress on their sovereign rights.
It is Iran that has done so.
Iran and North Korea comparisons are meaningless because they operate in very different environments with very different considerations. Iran can do anything North Korea can do, and better. But the two are subject to different goals and constraints.
For example, North Korea is a one man-led cult of autocratic leadership, Iran is the largest hybrid Islamic democracy in its region. Iranians will not accept living like North Koreans and Iranian civil society is far more advanced than virtually all of its regional peers, let alone North Korea.
FWIW, North Korea did agree to similar concessions under the 1994 Agreed Framework. And the vast majority of Iran's voluntary concessions (supposedly in exchange for economic integration with the West) are temporary (enrichment restrictions phased out after 10-15 years, UNSC sanctions lifted permanently in 2031, weapons embargo already lifted in 2020, etc) and provide time for Iran to complete work on IR-8/9 centrifuges that are not ready to be deployed yet (there are more theories about this that I don't want to go into).
10-15 years of restrictions (that allow Iran to continuously enrich uranium and are gradually lessened with time) in exchange for full lifting of UNSC sanctions (a major issue) and global acceptance of Iran's legal right to enrichment (immediate) and unlimited nuclear program (after 15 years - a blink of an eye in strategic terms), with economic integration during that period to incentivise all parties to maintain the deal, while Iran continues R&D on advanced centrifuges ready to be deployed at the end of this period. This was a solid decision at the time, albeit that it failed due to Trump being used by Netanyahu. But I believe it remains the best plausible path forward for Iran (if accompanied with suitable domestic policies and preparations).