Your companion (Muhammad SAW) has neither gone astray nor has erred.
It is only an Inspiration that is inspired.
Chapter 53 An-Najm : Verses 1-4
Allah swears the Messenger is True and His Words are a Revelation from Him
Ibn Abi Hatim recorded that Ash-Sha`bi and others stated that the Creator swears by whatever He wills among His creation, but the created only vow by the Creator. Allah said,
(By the star when it goes down.) Ibn Abi Najih reported that Mujahid said, “The star refers to Pleiades when it sets at Fajr.” Ad-Dahhak said “When the Shayatin are shot with it.” And this Ayah is like Allah’s saying;
(So, I swear by the setting of the stars. And verily, that is indeed a great oath, if you but know. That is indeed an honorable recitation. In a Book well-guarded. Which none can touch but the pure. A revelation from the Lord of all that exists.)(56:75-80) Allah said;
(Your companion has neither gone astray nor has erred.) This contains the subject of the oath. This part of the Ayah is the witness that the Messenger of Allah is sane and a follower of Truth. He is neither led astray, such as in the case of the ignorant who does not proceed on any path with knowledge, nor is he one who erred, such as in the case of the knowledgeable, who knows the Truth, yet deviates from it intentionally to something else. Therefore, Allah exonerated His Messenger and his Message from being similar to the misguided ways of the Christians and the erroneous paths of the Jews, such as knowing the Truth and hiding it, while abiding by falsehood. Rather, he, may Allah’s peace and blessings be on him, and his glorious Message that Allah has sent him with, are on the perfect straight path, following guidance and what is correct.
Muhammad was sent as a Mercy for all that exists; He does not speak of His Desire
(Nor does he speak of desire), asserting that nothing the Prophet utters is of his own desire or wish,
(It is only a revelation revealed.), means, he only conveys to the people what he was commanded to convey, in its entirety without additions or deletions. Imam Ahmad recorded that Abu Umamah said that he heard the Messenger of Allah say,
(Verily, numbers similar to the two tribes, or one of them, Rabi`ah and Mudar, will enter Paradise on account of the intercession of one man, who is not a Prophet.) A man asked, “O Allah’s Messenger! Is not Rabi`ah a subtribe of Mudar.” The Prophet said,
(I said what I said.) Imam Ahmad recorded that `Abdullah bin `Amr said, “I used to record everything I heard from the Messenger of Allah so it would be preserved. The Quraysh discouraged me from this, saying, `You record everything you hear from the Messenger of Allah , even though he is human and sometimes speaks when he is angry’ I stopped recording the Hadiths for a while, but later mentioned what they said to the Messenger of Allah , who said,
(Write! By He in Whose Hand is my soul, every word that comes out of me is the Truth.)” Abu Dawud also collected this Hadith.