Either there was a Pi-Ramses town 200 years earlier or the Exodus account was written 200 years later (and they used the current name of the town). It appears that Joshua was wriiten during the time of the judges of Israel or maybe Exodus was also. Leviticus was written by Moses.
There is evidence that it may not be mythological: Thutmoses II & Thutmoses III had boil scars; Thutmose III not related to Thutmose II (indicating the real Thutmose III -first born died); Egyptian hieroglyphs saying all Semitic peoples forced out of delta by reign of Thutmose III; earliest Hebrew homes in Canaan is same design as those of Egyptian Avaris in the delta.
These all line up with the Biblical account. The Hebrews were Egyptians.
You may not realize that the Bible says that they entered Canaan(way before 40 years). But after the Hebrew spies returned they refused to fight the Canaanites. They were scared! Only Caleb and Joshua said they could conquer with the Lord's help. But the people refused to fight.
Then God in anger turned them to go back to the desert for 40 years until that generation died out. Their children conquered Canaan with Joshua 40 years later.
Exodus was written between 922-722 BCE as a response to the division caused by Solomon where the northern and southern kingdoms formed. Believe it or not it had to do with an unpopular labor tax and the appointment of Jeroboam over Adonijah as high priest. I think it was Jeroboam.