It was narrated that Abu Hurairah said: "The Messenger of Allah ﷺ said: 'Whoever offers the funeral prayer in the mosque will have nothing (ie, no reward).’"
The Prophet Muhammad ﷺ taught us that we should always be mindful of our actions and intentions when performing any deed, especially those done in public places such as mosques. He reminded us that even if we offer funeral prayers at a mosque, there is no guarantee of a reward from Allah; rather it is His mercy alone which will determine whether or not we receive any rewards for our deeds.