You realize Muammar Gaddafi only died 12 years ago and Russia only invaded Ukraine two years ago? Nuclear weapon programs take at least that long to develop. Ukraine and Libya had programs (Ukraine actually had weapons) and abandoned them, much to their demise. If they kept their programs, they wouldn’t have had these problems.
Many of them will lack the lasting power of North Korea.