Allah tells us what Musa said to that learned man, who was Al-Khidr. He was one to whom Allah had given knowledge that He had not given to Musa, just as He had given Musa knowledge that He had not given to Al-Khidr.
قَالَ لَهُ مُوسَى هَلْ أَتَّبِعُكَ
(Musa said to him: "May I follow you...") This is a question phrased in gentle terms, with no sense of force or coercion. This is the manner in which the seeker of knowledge should address the scholar.
اتَّبَعَكَ
(I follow you) means, I accompany you and spend time with you.
عَلَى أَن تُعَلِّمَنِ مِمَّا عُلِّمْتَ رُشْداً
(so that you teach me something of that knowledge which you have been taught) meaning, teach me something from that which Allah has taught you so that I may be guided by it and learn something beneficial and do righteous deeds. At this point,
It is not permissible for an 'Alim’ of the 'Shari'ah' to patiently bear what is contrary to the Shari'ah
By saying: إِنَّكَ لَن تَسْتَطِيعَ مَعِيَ صَبْرًا وَكَيْفَ تَصْبِرُ عَلَىٰ مَا لَمْ تُحِطْ بِهِ خُبْرًا (You can never be able to keep patient while with me. And how would you keep patient over something your comprehension cannot grasp? - 67, 68), al-Khadir (علیہ السلام) was telling Sayyidna Musa (علیہ السلام) about the fact and the reason why he would be unable to keep patient with him. He knew nothing about the reality of the thing. What he meant was that the nature of knowledge given to him was different from the knowledge of Sayyidna Musa (علیہ السلام) ، therefore, things he did would appear to be objectionable in his sight, until he himself was to apprise him of their reality. Thus, the objections he would raise against such actions would be triggered by the dictates of his mission as a prophet.
God continuously manages the affairs of this world through His angels. Since this system is not visible to man, he does not fully grasp its secrets. He harbours different types of doubts due to his deficient knowledge. To remedy this, God has given the opportunity for indirect observation to certain of His selected subjects. He has arranged for them to observe His invisible world, so that they should see with their own eyes its wisdom and make others aware of it. Here, the incident relating to Moses is a similar type of exceptional event, by means of which he was given a glimpse of God’s invisible system. Moses is said to have undertaken this journey between Egypt and Sudan along with one young disciple Yusha‘ bin Nun (Joshua). By way of a sign, God had asked him to proceed on his journey until he reached a place where two seas came together. He was told that there he would find somebody (perhaps an angel in the shape of a human being), whom he was asked to accompany.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.