The Messenger of Allah ﷺ said, "Whoever hears a man calling out about a lost item in the mosque should say to him, 'May Allah not return it to you,' for the mosques were not built for this."
قال رسول الله ﷺ: من سمع رجلا ينشد ضالة في المسجد فليقل: لا ردها الله عليك، فإن المساجد لم تبن لهذا.
Muslim narrated it in "The Masjids" chapter (568) from the hadith of Haywa, from Muhammad bin Abdul-Rahman Abu Aswad Nawfali, from Abu Abdullah, the freed slave of Shaddad bin Had, that he heard Abu Hurairah say, and then he mentioned it.Tirmidhi narrated it (1321) through another route from Abu Hurairah as a raised report, with the wording, "If you see someone selling or buying in the masjid, say, 'May Allah not make your trade profitable.' And if you see someone seeking a lost item in it, say, 'May Allah not return it to you.'"Ibn Khuzayma narrated it (1305), Ibn Hibban (1650), and Hakim (2/56), all through the route of Abdul-Aziz bin Muhammad, who said, Yazid bin Khusayfa informed us, from Muhammad bin Abdul-Rahman bin Thawban, from Abu Hurairah, and then he mentioned it.Tirmidhi said, hasan gharib. I say, it is as he said, for Abdul-Aziz bin Muhammad, who is Darawardi, is "truthful." However, there is disagreement over whether his narration is connected or has a broken chain, and the correct view is that it has a broken chain, which is also the view favored by Daraqutni in "Al-Ilal" (10/65).