The firstborn plague is explained in the same chapter Ex12 where Yahweh wanted people to offer their firstborn son... yes it says that...
Therefore the story of the firstborn of Eygpt is just following suit... Micah 6 is famlier to witnesses... every knows verse 8... does anyone read the preceeding verses? Micha offers to offer his forborn son in the verses to Yahweh.
Judges 11 of course states an example of this
The point is although later Jewish editors obscered child sacrifice we know from archeology and the bible (in almost hidden paseges) this happened (Don't get me started on Abraham and Isaac)