Praise be to Allah.
We have not come across this report with any isnad, whether it be sahih (sound), da‘if (weak) or makdhub (fabricated). Moreover, it is contrary to what has been proven of the story of the Prophet’s Mi‘raj (ascent to heaven). In as-Sahihayn it is narrated that Allah, may He be glorified and exalted, addressed His Prophet (blessings and peace of Allah be upon him) by his name, which is Muhammad, not by the word “al-yateem (orphan).”
Regarding the story of how the five daily prayers were enjoined during the Mi‘raj, it was narrated from Anas ibn Malik: “Then al-Jabbar (the Compeller) said: ‘O Muhammad.’ He said: ‘Here I am at Your service.’ He said: ‘The word will not be changed with Me; it will be as I enjoined upon you in the Mother of the Book.’ He said: ‘Each good deed brings a tenfold reward; they are fifty (prayers) in the Mother of the Book (in terms of reward), and they are five (in practice) for you.’” Narrated by al-Bukhari (7517) and Muslim (162).
Moreover, being an orphan does not in and of itself indicate whether a person is praiseworthy or blameworthy; rather it is like anything else with which Allah may test His slaves, such as sickness, loss of loved ones and other calamities.
Furthermore, on the night of the Mi‘raj the Prophet (blessings and peace of Allah be upon him) was no longer an orphan, for he had passed the age of forty, and the state of orphanhood does not continue after a person reaches maturity. There are texts which indicate that this description no longer applies once the orphan reaches the age of puberty.
It was narrated from ‘Ali ibn Abi Talib [that he said]: I learned from the Messenger of Allah (blessings and peace of Allah be upon him) that there is no orphanhood after reaching the age of puberty. Narrated by Abu Dawud (2873). Shaykh al-Albani quoted similar and corroborating reports which support this text, then he said: To sum up, this hadith, with these isnads and corroborating reports, is sahih in my view. An-Nawawi classed its isnad as hasan in ar-Riyadh."(Irwa’ al-Ghalil 5/83).
Sounder than that is the hadith of Abu Hurayrah who said: Jibril sat before the Prophet (blessings and peace of Allah be upon him). He looked up at the heavens and saw an angel descending. Jibril said: This angel has never descended since the day he was created until this hour. When the angel had descended, he said: O Muhammad, your Lord has sent me to you [to ask you]: Should He make you a king-prophet, or a slave-messenger? Jibril said: Be humble before your Lord, O Muhammad. He said: “Rather a slave-messenger.”
Narrated by Imam Ahmad (12/76-77); classed as sahih by the commentators in al-Musnad and by Shaykh al-Albani in his commentary on Bidayat al-Sawl (p. 64).
See also the answer to question no. 224061 .
And Allah knows best.