Praise be to Allah.
Offering supplication for the deceased and praying for forgiveness for him is an act of worship, and there is nothing wrong with a person seeking forgiveness for his brother when carrying the bier and walking with it in the funeral procession. But with regard to calling out to the people, “Pray for forgiveness for your brother!”, a number of scholars disliked that and regarded it as an innovation that has been introduced into the religion. Ibn Abi Shaybah included a chapter in his Musannaf entitled: “What they say about a man saying behind the deceased [in the funeral procession]: ‘Pray for forgiveness for him, may Allah forgive you.’”
It was narrated that Ibraaheem said: It was disliked for a man to follow the bier saying, ‘Pray for forgiveness for him, may Allah forgive you.”
It was narrated that Bukayr ibn ‘Ateeq said: I was present at a funeral attended by Sa‘eed ibn Jubayr. A man said: Pray for forgiveness for him, may Allah forgive you! And Sa‘eed ibn Jubayr said: May Allah not forgive you!
It was narrated from ‘Ataa’ that he disliked saying: Pray for forgiveness for him, may Allah forgive you.
It says in Tuhfat al-Muhtaaj by al-‘Allaamah al-Haytami (may Allah have mercy on him) (3/188): Clamour is disliked; this refers to raising the voice, even in dhikr and recitation of Qur’an, when walking with the bier, because the Sahaabah (may Allah be pleased with them) disliked it at that time. This was narrated by al-Bayhaqi. Al-Hasan and others disliked shouting “Pray for forgiveness for your brother.” Moreover, Ibn ‘Umar said to one who said it: May Allah not forgive you! Rather one should remain silent, reflecting upon death and what is connected to it, and the departure from this world, remembering Allah quietly, not out loud, because that is a reprehensible innovation. End quote.
In Ahkaam al-Janaa’iz by Shaykh al-Albaani (may Allah have mercy on him) (1/250), it says that innovations include shouting behind the funeral procession, “Pray for forgiveness for your brother, may Allah forgive you,” and the like.
And Allah knows best.