Let's raise some rational concerns hypothetically concuring 'if the boy was brutally murdered by a stranger /visitor to the town accompanied by Allah's Messenger '....
1.... Is that town void of law against murder or this person is exempted from murdering or are they afraid of him?
2... Did he kill the boy and left him on the spot or did he burry him instantly and secretly or did he handover the deceased to the concerned?
3... Did he take permission of parents before killing him or all on his accord since he foresees future and did parents ever come to know their boy was murdered and did parents ever come to know the intention behind killing?
4... Had he asked permission of parents, would they give green signal and would they immediately realize his promise being an stranger in the Town.. Musa's reaction doesn't sound that he took permission from parents.. Does he?
5.... Would that be possible as parents to go through while the person is still a boy and harmless and not harmed anyone and killing for a latent reason.. ?
6... Would the society and the rulers allow for two strangers to murder an innocent boy of their town given the reasons that the parents would get a new baby soon and can they sneak through without being punished for felony and wouldn't the rulers prison the murderer until his prophesy come true.. how to trust and allow to murder one of their members and Scotfree ?
7... Most significantly, even if the boy grew up and became a rebellious disbeliver, then is killing the only option to curb parents being harmed in the future by this person and isn't their any other option at all as a wise man ? Is that what Musa came to learn?
8.....Cant this wise man secretly sell the boy to anyone(disbeliever) who wishes to adopt him as a son or slave and still let them have a new baby as future prophesied and let this boy grow up as a rebellious disbeliver somewhere else in the Earth and is he the only disbeliver in the Earth to spare him?
9... Can any parents tolerate an innocent boy being murdered with the promise of getting a new believing and pure boy similar to their belief in his stead? How cruel and selfish those parents could possibly be.. For their future security admitting murder willingly ?
10.... Why can't Allah take the boy's life naturally or through accident etc if indeed Allah intended to REPLACE the boy with another? Is that so difficult? Why not kill the boy when he grew up and a actual threat to his parents in all wildest manners..?
11.... Is that the ideal solution from the Lord, I mean to kill everyone who grow up with latent potentiality to be rebellious people to communities of believers? Then what's the reason of creation of human being with freewill while most of them are destined for humiliation in the hereafter.