'The king' in Joseph's story, 'Pharaoh' in Moses' story
And [subsequently] the king said, "Indeed, I have seen [in a dream] seven fat cows being eaten by seven [that were] lean, and seven green spikes [of grain] and others [that were] dry. O eminent ones, explain to me my vision, if you should interpret visions."Quran 12:43, Sahih International
Then We sent after them Moses with Our signs to Pharaoh and his establishment, but they were unjust toward them. So see how was the end of the corrupters. And Moses said, "O Pharaoh, I am a messenger from the Lord of the worldsQuran 7:103-104, Sahih International
What happened
The Quran calls Egypt's ruler 'the king' (al-malik) throughout the story of Joseph (peace be upon him) and 'Pharaoh' (Fir'awn) throughout the story of Moses (peace be upon him). The Bible uses 'Pharaoh' in both stories. Egyptologists note that the Egyptian per-aa ('great house') was a name for the palace and came to be used for the king himself mainly from the New Kingdom (from about the 15th century BC).
The Muslim case
Islamic Awareness and Sh. Mohammad Elshinawy (Yaqeen Institute) argue that the Quran's usage fits this history: Joseph is usually placed earlier than the New Kingdom, often in the Hyksos period of foreign rulers, and Moses later. Elshinawy quotes Maurice Bucaille on the knowledge of hieroglyphs having been lost until the 19th century.
Scope
The dates of Joseph and Moses are not settled in Egyptology, and per-aa appears in earlier texts as a name for the palace. The Muslim case is a consistent pattern in the Quran that fits Egyptological findings.