En bref
The news of Herod’s intention to kill Jesus would have surprised Joseph, since both he and the wise men had been told that Herod wanted to worship Jesus.
Yes, it would, for the Magi had just told him that Herod wanted to come to worship the child. When they were told in a dream not to return to Herod, they would have of course been suspicious concerning the king’s plan, but, so far as we know, even then nothing was known about the active, aggressive intentions of Herod. If they did, we could assume that the Magi would probably not have left the child and his mother to fend for themselves, even if Joseph possibly already considered leaving the village .1
13 Lorsqu'ils furent partis, voici, un ange du Seigneur apparut en songe à Joseph, et dit: Lève-toi, prends le petit enfant et sa mère, fuis en Egypte, et restes-y jusqu'à ce que je te parle; car Hérode cherchera le petit enfant pour le faire périr.