It is mentioned in the Hadith of Bukhari from Abdullah ibn e Masud that:
“We used to recite this (السَّلاَمُ عَلَيْكَ أَيُّهَا النَّبِيُّ – Peace and Allah’s Mercy and Blessings be on you, O Prophet!) in the prayer during the lifetime of the Prophet (ﷺ) , but when he had died, we used to say: السَّلاَمُ عَلَى النَّبِيِّ – Peace be on the Prophet“.
(https://sunnah.com/bukhari:6265)
Same wording “السَّلاَمُ عَلَى النَّبِيِّ” is also narrated from Hazrat Aisha (rta) as well, as mentioned in Musnad al-Siraj, which according to Shiekh Albani is from a sound chain of narrators.
But the wordings from Abdullah ibn e Abbas, Abdullah ibn e Umar, Abu Musa Ashari and Umar ibn e Khattab have the words ” السَّلاَمُ عَلَيْكَ أَيُّهَا النَّبِيُّ“. It is also mentioned in Musnaf Abdur Razzaq from a sound chain of narrators from Ataa that Sahaba used to recite السَّلاَمُ عَلَيْكَ أَيُّهَا النَّبِيُّ – Peace and Allah’s Mercy and Blessings be on you, O Prophet! in the prayer during the lifetime of the Prophet (ﷺ) , but when he had died, they used to say: السَّلاَمُ عَلَى النَّبِيِّ – Peace be on the Prophet“.
The point being that none of the Sahaba used to recite this on the belief that Prophet (sws) was hazir-o-Nazir (present) among them. This supplication started during time of the Prophet (sws) when he used to be present in front of the Sahaba, so they used to recite with السَّلاَمُ عَلَيْكَ أَيُّهَا النَّبِيُّ, and this tradition carried forward with the same words; and some of the Sahaba changed the wordings to make it more appropriate to the changing circumstances and maybe some carried forward the tradition. These words are not an obligatory supplication of the Salah to be recited at all costs in the same exact manner, that is why we see some difference in wordings of this supplication as recited by different Sahaba. One can opt to either change these words or can carry forward with the same traditional wordings. It is neither an obligatory supplication, nor there is any requirement to recite the same exact words in the same exact order; but a very beatiful supplication nervetheless.
However, saying such words with a belief that Prophet (sws) is hazir-o-Nazir (present) would tanamount to Shirk.