“The shepherds attended the birth of Jesus. The wise men came after Jesus was already a toddler and living in a different city.”
Neither nativity tradition in the Gospels (and they are both seperate and not particularly complimetary with each other) says this.
Luke has shepherds attending the birth which occurs in Bethlehem, the couple having journeyed from Nazareth and staying in a stable. They then leave and return directly to Nazareth. No wise men or Egypt detour.
Matthew has the couple living in a house in Bethlehem (no stable or shepherds), then the Wise Men come to Bethlehem as directed. After they leave the family flee to Egypt and then later move to Nazareth.