Ibn Abi Layla was Muhammad ibn ‘Abd al-Rahman ibn Abi Layla. He was weak due to deficiencies in his memory. On one occasion, he narrated it through a different chain of transmission. Ahmad (5/402) said: Waki‘ narrated to us from Ibn Abi Layla, from a shaykh named Hilal, from Hudhayfah, who said: “I asked …” and then cited the hadith. Ibn Abi Shaybah likewise reported it.
The correct version is his first narration from Abu Dharr, as corroborated by the reports of Abu Basrah al-Ghifari and Mujahid from him. Allah knows best.
Abu al-Ahwas also narrated it from Abu Dharr as a hadith attributed to the Prophet, with the wording:
“If one of you stands for prayer, let him not smooth the pebbles, for mercy is facing him.”
With this wording, it is weak, as I established in al-Irwa (2/97/377). In Sahih al-Bukhari (1207) and Sahih Muslim (546), there is corroboration for it in the hadith of Mu‘ayqib, may Allah be pleased with him.
3063 — “Indeed, among the most outrageous lies is for a person to claim to have seen in a dream what he did not see.”
Ahmad (2/96)—the wording is his—and al-Bukhari (7043) narrated it through the route of ‘Abd al-Rahman ibn ‘Abd Allah ibn Dinar, the freedman of Ibn ‘Umar, from his father, from Ibn ‘Umar: that the Messenger of Allah, peace and blessings be upon him, said … and then cited it.
I say: Although this ‘Abd al-Rahman was among al-Bukhari’s narrators, he had weakness due to deficiencies in his memory. Al-Hafiz was lenient in his assessment of him in Fath al-Bari, saying under this hadith (12/420):
“Scholars differed concerning him. Ibn al-Madini said: ‘Truthful.’ Ibn Ma‘in said: ‘In my view, there is weakness in his hadith.’ Al-Daraqutni said: ‘Al-Bukhari differed from the other scholars concerning him, yet he is not abandoned.’ I [al-Hafiz] said:”