According to the Quran 18:65–82, Moses meets a man(called the Servant of God) Moses asks for permission to accompany the Servant of God so Moses can learn "right knowledge of what he hasbeen taught. The Servant informs him that "surely you [Moses] cannot have patience with me. And how canst thou have patience about things about which thy understanding is not complete?" Moses promises to be patient and obey him unquestioningly, and they set out together.
this Servant of God commited such acts:
1- After they board a ship, the Servant of God damages the vessel. Forgetting his oath, Moses says, "Have you made a hole in it to drown its inmates? Certainly you have done a grievous thing."
2- Next, the Servant of God kills a boy. Moses again cries out in astonishment and dismay, and again the Servant reminds Moses of his warning, and Moses promises that he will not violate his oath again etc..
later the servant of God reasoned his act of killing the boy ,telling Moses :
Quran 18:81 “And as for the boy, his parents were ˹true˺ believers, and we feared that he would pressure them into defiance and disbelief.So we hoped that their Lord would give them another, more virtuous and caring in his place.
How rational such Quranic argument ,with regard to God allowing killing the boy for a greater good (according the author of the Quran) ?