For centuries it was thought that all Egyptian rulers were referred to as Pharaohs. Actually the Christian Bible insists that Abraham and Joseph interacted with Pharaohs. However modern discoveries show that this cannot be true. Pharaoh is a title given to rulers in the Egyptian New Kingdom, not before.
Before the New Kingdom the word "Pharaoh" meant "Great House" and it referred to the buildings of the court or palace but not to the ruler.
PharaohFrom the Twelfth Dynasty onward, the word appears in a wish formula "Great House, May it Live, Prosper, and be in Health", but again only with reference to the royal palace and not the person. Sometime during the era of the New Kingdom, Second Intermediate Period, pharaoh became the form of address for a person who was king.
So there were no Pharaohs at the time of Abraham or Joseph; they were just kings. But the Quran didn't do this mistake. The Quran correctly addressed the ruler at the time of Joseph as King, and correctly addressed the ruler at the time of Moses as Pharaoh.
The Egyptian ruler at time of Joseph was a king:
٥٤ وَقَالَ الْمَلِكُ ائْتُونِي بِهِ أَسْتَخْلِصْهُ لِنَفْسِي ۖ فَلَمَّا كَلَّمَهُ قَالَ إِنَّكَ الْيَوْمَ لَدَيْنَا مَكِينٌ أَمِينٌ
The Egyptian ruler at time of Moses was a Pharaoh:
٢٦ وَقَالَ فِرْعَوْنُ ذَرُونِي أَقْتُلْ مُوسَىٰ وَلْيَدْعُ رَبَّهُ ۖ إِنِّي أَخَافُ أَنْ يُبَدِّلَ دِينَكُمْ أَوْ أَنْ يُظْهِرَ فِي الْأَرْضِ الْفَسَادَ
No mistakes in the Quran.
How could an illiterate man who lived 1400 years ago have known who was Pharaoh and who was not?
The Quran (Koran, the book of Islam) contains scientific knowledge that could not have been known 1400 years ago. It ranges from basic arithmetics to the most advanced topics in astrophysics. You are invited to go through those miracles and judge for yourself.