It didn't "appear over" Jerusalem at all. A star was seen by magi in the east and was interpreted as hailing the birth of the King of the Jews. They went to the capital to honor him. The story assumes you know that the whole world was awaiting the Messiah and had interpreted Numbers 24:17 the way the author and many Jews did. https://en.wikipedia.org/wiki/Star_Prophecy
I shall see him, but not now: I shall behold him, but not nigh: there shall come a Star out of Jacob, and a Sceptre shall rise out of Israel,
In the story they proceed to Bethlehem (to again"fulfill prophecy")
Their efforts were assisted by the star now somehow appearing over the house. It's a bit of a stretch of course but that is legend making. This allowed them to give gold and frankincense to "fulfill" another prophecy (Is 60:3,6)
“Nations will come to your light, and kings to the brightness of your radiance…. They will carry gold and frankincense and proclaim the praises of the Lord
The whole classic Herod killing the baby boys is another typological "prophecy" from the Moses story. To have it 'fulfilled' required the Magi go to Jerusalem first.
The Egypt "prophecy" is likewise made possible by the mention of the family fleeing there,
so to the subsequent moving to "Nazar"eth to fulfill the "prophecy" that he would be a "Nazar"ene. (perhaps reaching a bit with the word Nezer, the village didn't exist until centuries after the OT was written or seeing another typology in Samson, Samuel or John the Baptist being Nazarites).
I know you are a believer but the story here and in Luke are each constructed from elements from the OT. The star is not a nefarious plot but a miraculous supernatural sign of the birth. The version Ignatius is familiar with especially makes clear that point.