A man from Aslam came to the Prophet ﷺ and confessed to committing adultery. The Prophet ﷺ turned away from him. He confessed again, and the Prophet ﷺ turned away from him. He confessed once more, and the Prophet ﷺ turned away from him, until he had testified against himself four times.The Prophet ﷺ then asked, "Are you mad?"He replied, "No."The Prophet ﷺ asked, "Have you been married?"He replied, "Yes."So the Prophet ﷺ ordered that he be stoned. When the stones struck him painfully, he fled, but he was caught and stoned until he died. The Prophet ﷺ spoke well of him but did not perform the funeral prayer over him.
أخبرنا محمد بن يحيى ونوح بن حبيب قالا حدثنا عبد الرزاق قال حدثنا معمر عن الزهري عن أبي سلمة بن عبد الرحمن
أن رجلا من أسلم جاء إلى النبي ﷺ فاعترف بالزنا فأعرض عنه ثم اعترف فأعرض عنه ثم اعترف فأعرض عنه حتى شهد على نفسه أربع مرات فقال النبي ﷺ أبك جنون قال لا قال أحصنت قال نعم فأمر به النبي ﷺ فرجم فلما أذلقته الحجارة فر فأدرك فرجم فمات فقال له النبي ﷺ خيرا ولم يصل عليه
Bukhari narrated it in the Book of Punishments, Chapter on Stoning at the Prayer Place, no. 6820, and Muslim in the Book of Punishments, Chapter on One Who Confesses to Fornication, no. 16/1691, from the hadith of Abdul-Razzaq through the same chain. It is also in Kubra, no. 2083, and Musannaf Abdul-Razzaq, 7/320, no. 13337.As for his statement, "and he did not pray over him," this means he did not pray over him at that particular time, then he prayed over him afterward, as indicated by Bukhari's wording, "and he prayed over him," along with other evidence. So dismissing Bukhari's narration as mistaken is itself a mistake.