The Messenger of Allah ﷺ said to a man, "You did such and such."The man replied, "No, by the One besides whom there is no god, Messenger of Allah, I did not do it."The Prophet ﷺ said, "Yes, you did do it, but you have been forgiven on account of your sincere declaration of faith."
حدثنا عبد الصمد حدثنا حماد حدثنا ثابت
أن رسول الله ﷺ قال لرجل فعلت كذا وكذا فقال لا والذي لا إله إلا هو يا رسول الله ما فعلت قال بلى قد فعلت ولكن غفر لك بالإخلاص
Its chain is daif due to a break in transmission, since Thabit Bunani did not hear it from Ibn Umar. This is a repetition of 5380. We have already discussed its defect in detail at 5361, and pointed to this there. Here we add that the hadith appears in Majma al-Zawaid 10:83, where it is said, Ahmad and Abu Yaala narrated it similarly, and the men in their chains are the men of the Sahih, except that Hammad bin Salama said that Thabit did not hear this from Ibn Umar, and that there was a man between them. This statement of Hammad's has already been given at 5361.