There’s a lot of sloppy research by screenwriters. For example, in “Swing Kids,” the Nazi invasion of Poland comes before the Sudeten crisis—kind of like having the Battle of Fort Sumter coming before the Dred Scott decision.
I like the old movie “The Ten Commandments”, but the screenwriters liberties taken with the story are numerous.
For example, Moses killed the Egyptian taskmaster, buried the body, and thought no one knew it, until the next day when Hebrew slaves mentioned it to him. He promptly fled Egypt.
In the movie, he is captured shortly after the murder, and sentenced to die by a slow death in the desert.
However, in order to make a 3 hour movie, Moses life up to that event needed some filling in where the scriptures are silent. So making Moses a general in Pharaoh’s army, and an architectual engineer, was as good a guess as anything else the writers could dream up.