the source for the euclid/ptolemy discussion is proclus, and it is probably apocryphal, there. i have a copy of proclus' commentary on the shelf; he was an important (neo-)platonist near the end of the classical period (traditionally ending when justinian closed the academy), but this is very late for a source about euclid - it was nearly 1000 years later. i know that we tend to blur the classical period together, but 1000 years is a long, long time. it's very hard to take a story like that about anybody seriously at so far removed a date.
when i said "i remembered it as being heron", i was referencing something i learned in a course on non-euclidean geometry (70.427 at carleton) many years ago. there's a text called the non-euclidean revolution by richard trudeau that's a pretty gentle intro, so gentle that it's a probably better called a philosophy text than a math text, and it might be in there, but i don't remember entirely. what i remember is a comment by the professor (brian mortimer) that the whole euclid thing was presented in proclus from an earlier reference to heron, probably because euclid is fucking euclid and heron was...you've never heard of him, have you? he was important, but he wasn't euclid. apparently, the story was also sometimes told with archimedes as the geometer, rather than euclid.
i'm pretty knowledgeable about the period, and i might suspect that the story isn't even greek, let alone egyptian. heron actually lived in the roman period, so he wouldn't be talking to a greek pharoah named ptolemy, he'd have been taking to a roman governor. but, the use of the term royal road suggests a potentially earlier persian reference, as the royal road was the road that ran through the persian empire from the greek regions of asia minor (modern day turkey), and back to the elamite capital of susa (shush, in modern day iran), which the persians used as an administrative capital (they had multiple capitals in their empire, essentially a collection of the capitals of the constituent civilizations that they very rapidly conquered). so, if the earliest references that we have point to heron being the author, it may have gotten merged with an earlier story about the persian king of kings, or adapted from it.
something else to note is that proclus may have even been killed for treason if he had told a story that glorified the then iranian/parthian monarch in too great detail, as the romans were in the midst of a thousand year war with the iranians. that might be the motive in telling the story about euclid & ptolemy, rather than about the persian monarch.
but, my statement stems from a vague recollection of something i learned in class that was intended to debunk the euclid reference, which is at virtually every site, due to the importance of proclus. you'd only find it in specialist literature, and i've entirely forgotten where, if i ever read it rather than heard it at all.