I heard the Messenger of Allah ﷺ say, "Whoever hears a man announcing 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."
حدثنا أبو عبد الرحمن المقرئ حدثنا حيوة قال سمعت أبا الأسود يقول أخبرني أبو عبد الله مولى شداد أنه
سمعت رسول الله ﷺ يقول من سمع رجلا ينشد في المسجد ضالة فليقل له لا أداها الله إليك فإن المساجد لم تبن لهذا
Its isnad is sahih. Abu Aswad is Muhammad bin Abdul-Rahman bin Nawfal, nicknamed the orphan of Urwa, and Abu Abdullah, the freed slave of Shaddad, is Salim bin Abdullah Nasri, with a nun and unpointed sad, the freed slave of the Nasris.