King Hammurabi is the best known of the early monarchs of ancient times... belonged to the First BabyIonian Dynasty which came to an end, under circumstances shrouded in mystery, some three or four generations after Hammurabi. For the next several centuries, the land was in the domain of a people known as the Kassites. They left few examples of art and hardly any literary works -- theirs was an age comparable to and contemporaneous with that of the Hyksos in Egypt, and various surmises were made as to the identity of the two peoples. A cartouche of the Hyksos king Khyan was even found in Babylonia and another in Anatolia, a possible indication of the extent of the power and influence wielded by the Hyksos. Until a few decades ago, the reign of Hammurabi was dated to around the year 2100 before the present era... At Platanos on Crete, a seal of the Hammurabi type was discovered in a tomb together with Middle Minoan pottery of a kind associated at other sites with objects of the Twelfth Egyptian Dynasty, more exactly, of its earlier part. This is regarded as proof that these two dynasties were contemporaneous... however... At Mari on the central Euphrates, among other rich material, a cuneiform tablet was found which established that Hammurabi of Babylonia and King Shamshi-Adad I of Assyria were contemporaries. An oath was sworn by the life of these two kings in the tenth year of Hammurabi, The finds at Mari "proved conclusively that Hammurabi came to the throne in Babylonia after the accession of Shamshi-Adad I in Assyria"... The Khorsabad list ends in the tenth year of Assur-Nerari V, which is computed to have been -745... the first year of Shamshi-Adad is calculated to have been -1726 and his last year -1694... it reduced the time of Hammurabi from the twenty-first century to the beginning of the seventeenth century... "a puzzling chronological discrepancy", which could only be resolved by making Hammurabi later than Amenemhet I of the Twelfth Dynasty... If Hammurabi reigned at the time allotted to him by the finds at Mari and Khorsabad -- but according to the finds at Platanos was a contemporary of the Egyptian kings of the early Twelfth Dynasty -- then that dynasty must have started at a time when, according to the accepted chronology, it had already come to its end. In conventionally-written history, by -1680 not only the Twelfth Dynasty, but also the Thirteenth, or the last of the Middle Kingdom, had expired.
One of the Amenhemhets was the hero of a series of romance novels that I had when I was a teenager.
Then again royal names have frequently been reused over the centuries, and not always one right after another as was the case with the Rameses clan or the Ptolemys.