The Prophet (ﷺ)'s Uncertainty of Salvation
Some people may conclude that, according to these Islamic sources, the Prophet wasn't even certain about his own salvation, let alone that of others:
Say: "I am no new thing among the messengers (of Allah), nor do I know what will be done with me or with you. I do but follow that which is inspired in me, and I am but a plain warner."
46:9
By Allah, and although I am Allah's Messenger (ﷺ), I do not know what will be done to me.
Bukhari 1243/2687
And by Allah, though I am the Apostle of Allah, yet I do not know what will be done to me.
Bukhari 3929
And by Allah, in spite of the fact that I am Allah's Messenger (ﷺ), I do not know what will be done to me.
Bukhari 7003
By Allah, though I am Allah's Messenger (ﷺ), I neither know what will be done to me, nor to you.
Bukhari 7018
First and foremost, the statements are general and flexible, so they aren't even specifically referring to salvation in the Hereafter but rather referring to what will be done to him by the disbelievers of the Quraysh tribe and what will be done to them by Allah. This can be supported by Tafsirs of 46:9:
Say: "I am not a novelty, unprecedented, among the messengers, that is to say, I am not the first to be sent by God as His Messenger. Already many of them have come before me, so how can you deny me? Nor do I know what will be done with me or with you, in this world; will I be made to leave my native land, or will I be slain as was done with some prophets before me, or will you stone me to death, or will the earth be made to swallow you as it did to deniers before you? I only follow what is revealed to me, that is, the Quran, and I do not invent anything myself, for I am only a plain warner; one whose warning is plain."
Tafsir al-Jalalayn (46:9)
Secondly, even if they were referring to salvation, then the Prophet is merely a warner, and he doesn't know anything of the Unseen except that which he has been informed by Allah, but here, the verse and Hadiths quoted were uttered before the Prophet was informed by Allah that he was going to Paradise. The Hadiths were said in agreement with 46:9, which comes from the 46th chapter of the Quran, Sūrat al-Ahqāf; chronologically, this specific chapter is Meccan (i.e., it has been revealed before the Hijrah from Mecca to Medina).
Now, the first verse in the Quran which guarantees salvation to the Prophet is from Sūrat al-Fath, which is a Medinan chapter (i.e., it has been revealed after the Hijrah):
Indeed, We have granted thee a manifest victory; that Allah may forgive thee of thy sin that which is past and that which is to come, and may perfect His favor unto thee, and may guide thee on a right path.
48:2
After holding knowledge of this verse, the Prophet finally knew what Allah would forgive his sins and perfect His favor unto him:
I would be the first to knock at the door of Paradise.
Muslim 196b