Someone predicting the ending of a story makes sense when there is an explanation for the prediction.
The story of Jesus is not only a religious story, but one which predicts the ending and not all stories do predict the ending in such direct fashion. An explanation for the prediction of the ending must be given in the story, otherwise one may ask, how did he know and why did he tell others. This is good practice in terms of writing and should give a cohesive reason as to why a character knew and told others about the ending. Next is the religious story, followed by why it is proficient writing as it predicted the ending effectively.
Jesus’ story ends on earth two thousand years ago. We are told from the Bible Jesus died and resurrected (and later ascended back to heaven and is now seated there). Jesus knew this even before it happened (Matthew 20:17-19). Did he know supernaturally? Or could he tell from the signs about him? There might have been social indicators that showed Jesus what would happen to him. Why was it important for others to be told? Someone telling others about the ending of his life must have a reason to make sense.
Jesus knew what would happen to him (Matthew 20:17-19; it would be done to him) – and we may have an idea how he knew himself – but he told his disciples so they would benefit from this knowledge later. Jesus told his disciples (in John’s gospel) that God’s Spirit will remind them of what he said and then they would understand why Jesus died and rose from the dead later even though they did not understand now. Jesus was interested I think in the timing of such, and the Spirit was only given to them after Jesus’ death and resurrection. So, predicted endings do make sense when there is a reason for it. True in terms of writing, true in terms of the story of Jesus.