According to Matthew, Joseph & Mary left Egypt the night King Herod died, traveled towards home, but were frightened because "Archelaus was reigning over Judea". Even accepting the miraculous departure, there are several odd things about this return. At least three, in particular:
First, which son of Herod did Joseph think would be ruling? Second, why was it Archelaus in particular that caused Joseph to fear? Third, who did Joseph think was in charge of Galilee, at that time?
To the first question: If the Massacre of the Innocents took place before mid-6 BC, Joseph would have remembered Herod's famous son Antipater as the chosen successor. If Joseph & Mary lived in Alexandria, or anywhere that heard big news from Judea, they would also have learned about Antipater's imprisonment (for deviously sending two of his brothers to the executioner) but probably did not know which remaining son (Archelaus, Antipas or Philip) would be taking Antipater's place. As if anyone did, before Herod died. (The choice of Antipas, confirmed by Caesar over the winter, may not yet have been made public knowledge, and Herod changed his mind almost as soon as Caesar's approval arrived.)
Thus, it actually makes sense that the succession of Archelaus would have been news to Joseph.
To the second question: All that we know about Archelaus suggests the young prince had virtually no reputation whatsoever around the Kingdom before his announcement. Optimistic crowds entreated him before Passover and all indications are that these crowds held at least modest hopes for a kinder more generous King. Why, then, could Joseph have been afraid? The only reason we can supply is that Archelaus presided over a massacre of 3,000 pilgrims that year, on the Passover Day. In that light, the text of Mt.2:22 could shift slightly towards a very strong sense of ἀντὶ - on behalf of, or in place of - meaning, for example, something like, 'much in the way of'.*
Thus, it was probably not so much that Archelaus ruled which frightened Joseph, as much as how he was ruling. He was ruling ἀντὶ Herod the Great.
That's two down. But our third question may be the most difficult.
To be continued...
*Note: Matthew's other uses of ἀντὶ are also very strong. An eye ἀντὶ an eye, a tooth ἀντὶ a tooth. Pay the tax ἀντὶ [both] me and you. [I came] to give my soul as ransom ἀντὶ many. (Mt. 5:38, 17:27, 20:28) It's not just "okay, now it's your turn". If ἀντὶ means "in the place of" it means fully in place of, or as if he were him.