The Prophet ﷺ said, "O Allah, this is Your servant and the son of Your servant. He used to testify that there is no god but You and that Muhammad is Your servant and Messenger, and You know him best. If he was a doer of good, increase him in his good deeds, and if he was a wrongdoer, forgive him. Do not deprive us of his reward, and do not lead us astray after him."
عن النبي ﷺ قال: اللهم عبدك وابن عبدك، كان يشهد أن لا إله إلا أنت وأن محمدا عبدك ورسولك وأنت أعلم به، إن كان محسنا فزده في إحسانه، وإن كان مسيئا فاغفر له، ولا تحرمنا أجره ولا تفتنا بعده.
Abu Yaala reported it in Maqsad Ali (465) from Wahb bin Baqiya, from Khalid bin Abdullah, from Abdul-Rahman bin Ishaq Madini, from Saeed bin Abu Saeed, from Abu Hurairah, and he mentioned the hadith. Ibn Hibban graded it sahih (3073), reporting it from Abu Yaala, who is Ahmad bin Ali bin Muthanna Mawsili, with the same wording. Its chain of transmission is sahih. Haythami said in Majma (33/3), "Abu Yaala reported it, and its narrators are the narrators of the Sahih."I say, it is as he said. However, Malik reported it in the Book of Funerals (17), and from him Abdul-Razzaq in Musannaf (6425), from Saeed bin Abu Saeed Maqburi, from his father, that he asked Abu Hurairah, "How do you pray over the funeral?" Abu Hurairah said, "By the life of Allah, I will tell you. I follow it from its family, and when it is set down, I say Allahu Akbar and praise Allah, and I invoke blessings upon the Prophet, then I say," and he mentioned the supplication, without attributing it to the Prophet.There is no break in this chain, as some have claimed, for Saeed bin Abu Saeed Maqburi narrated from his father, from Abu Hurairah, and he also narrated from Abu Hurairah directly without going through his father. As for Malik's stopping the hadith at Abu Hurairah without raising it to the Prophet, this may go back to Saeed bin Abu Saeed Maqburi, for his memory became confused before his death, so perhaps he narrated it once as raised to the Prophet, then later doubted and narrated it as a stopped report. What is certain should be taken, and what is doubtful should be set aside.As for what is reported from Ali bin Shammakh, who said, I witnessed Marwan asking Abu Hurairah, "How did you hear the Messenger of Allah ﷺ pray over the funeral?" He said, "Is this along with what you said?" He said, "Yes." He said there had been words between them before that. Abu Hurairah said, "O Allah, You are its Lord, and You created it, and You guided it to Islam, and You have taken its soul, and You know best its secret and its open affairs. We have come to You as intercessors, so forgive it." This is daif.Abu Dawud reported it (3200) from Abu Muamar Abdullah bin Amr, who said, Abdul-Warith narrated to us, Abu Jalas Uqba bin Sayyar narrated to us, Ali bin Shammakh narrated to me, saying, I witnessed Marwan ask Abu Hurairah, "How did you hear the Messenger of Allah ﷺ pray over the funeral?" and he mentioned the hadith similarly.Imam Ahmad also reported it (7477) from Yazid, who said, Shuba informed us, from Jalas, from Uthman bin Shammas, who said, I heard Abu Hurairah, and Marwan passed by him and said, part of his hadith from the Messenger of Allah ﷺ, or your hadith from the Messenger of Allah ﷺ, then he turned back. We said, "Now he will confront him about it." He said, "How did you hear the Messenger of Allah ﷺ pray over funerals?" and he mentioned it.Abu Dawud said, Shuba erred in the name Ali bin Shammakh, calling him Uthman bin Shammas instead. And I heard Ahmad bin Ibrahim Mawsili relate to Ahmad bin Hanbal, saying, "I do not know of a single sitting I had with Hammad bin Zayd in which he did not warn against Abdul-Warith and Jafar bin Sulayman." End of quotation.This hadith has been reported through many chains of transmission, and when they are gathered together, it becomes clear that there is inconsistency in the chains, unidentified narrators among some of the transmitters, and disagreement over whether the report is stopped or raised to the Prophet. See these chains and their differences in the Book of Supplication by Tabarani (1179, 1180, 1182, 1183, 1184, 1185).