Earlier quoted context omitted.
We know these names because the Rosetta Stone (and other dual-language inscriptions) allowed researchers to figure out which Greek letter the egyptian hieroglyphics mapped to. There is also the Coptic language, which is a modern descendent of Ancient Egyptian. However, these pronunciations are full of issues and uncertainties - in part because, as the OP states, even figuring out how exactly Greek was pronounced is s…
Makes sense, BTW I appreciate all the sibling replies as well. So basically it seems they used the proper nouns to start and then built up on that. And also used Coptic to fill gaps.. I do get the point about Greek approximation since just as an example in modern India, Alexander is referred to as Sikander . Similar, yet very different.
In the case of Ramses specifically, there is also a piece of biblical evidence, the city recorded in Hebrew as something like "Raamses". https://en.wikipedia.org/wiki/Pi-Ramesses#Biblical_Ramesses
The two biblical cities of Pithom and Raamses are traditionally identified as the Egyptian "per-Atum" and "per-Ramesses", for some convention on spelling the Egyptian names.