What is established by the Quran and Sunnah can only be challenged by evidence capable of countering it.
Those who hold the former view say:
Allah Most High has not commanded that anyone be punished for something He knows that person will do before they actually do it. Nor does He, glory be to Him, punish His servants for what He knows they will do until they have done it.
A proponent of this view further says:
The account of al-Khidr contains no instance of access to unseen matters unknown to people generally. Rather, it describes his knowledge of circumstances of which Moses was unaware, such as his knowing that the boat belonged to poor people and that beyond them was an unjust king. Others could also know this.
Likewise, the fact that the wall belonged to two orphan boys and that their father had been a righteous man could have been known to many people. Similarly, the boy’s disbelief could have been known to many people, even his parents. Yet, out of love for him, they may not have rebuked him, or he may not have accepted their rebuke.
If that was the case, the verse provides no evidence at all. If, on the other hand, the boy had not yet disbelieved at all, but it was foreknown that he would disbelieve upon reaching puberty, this likewise shows that he was killed before becoming a disbeliever.
Those who hold this view say that he was killed to avert his evil, just as Noah said:
“My Lord, do not leave a single disbeliever on earth. * If You leave them, they will lead Your servants astray and beget none but wicked disbelievers.”