Praise be to Allah, and may peace and blessings be upon the Messenger of Allah.
The hadith mentioned in the question is not authentically attributed to the Prophet ﷺ. No authentic or weak chain of transmission for it is known in the recognized books of Sunnah. Rather, it circulates on some websites and forums without verification. Therefore, it is not permissible to attribute it to the Prophet ﷺ.
However, it is authentically established in the Sunnah that a righteous deed may appear in the form of a handsome man for the believer. This is mentioned in the hadith of al-Bara’ ibn ‘Azib رضي الله عنه, in which it is stated that after the believer dies, a man with a handsome face, fine clothes, and pleasant fragrance comes to him and gives him glad tidings of what pleases him. When he asks, “Who are you?” the man replies: “I am your righteous deed.” Narrated by Ahmad; al-Albani declared it authentic.
It is also established in the hadith of Buraydah رضي الله عنه that the Qur’an will meet its companion on the Day of Resurrection in the form of a pale man and say to him: “I am your companion, the Qur’an.” The person devoted to the Qur’an will then be honored and will ascend through the levels of Paradise according to the amount of Qur’an he recited. Narrated by Ahmad and Ibn Majah; a number of scholars considered it hasan.
As for the famous lengthy story claiming that the Qur’an enters between the deceased’s shroud and chest, prevents Munkar and Nakir from questioning him, then transforms into a handsome man and says to the deceased, “I am the Qur’an that you used to recite,” it is not authentically established from the Prophet ﷺ.
It is obligatory to be cautious about spreading unverified hadiths, even if the intention is to encourage people to read the Qur’an and perform righteous deeds; a good intention does not make it permissible to lie about the Messenger of Allah ﷺ. The Prophet ﷺ said:
“Whoever deliberately lies about me, let him take his seat in Hellfire.” Narrated by al-Bukhari and Muslim.
And Allah knows best.