The chief of the hypocrites died in Medina, and he had left instructions that the Prophet ﷺ should pray over him and shroud him in his shirt. So the Prophet ﷺ prayed over him, shrouded him in his shirt, and stood at his grave. Then Allah revealed, "And never pray for any of them who has died, nor stand at his grave" [Tawbah 9:84].
حدثنا عمار بن خالد الواسطي وسهل بن أبي سهل قالا حدثنا يحيى بن سعيد عن مجالد عن عامر
مات رأس المنافقين بالمدينة وأوصى أن يصلي عليه النبي ﷺ وأن يكفنه في قميصه فصلى عليه وكفنه في قميصه وقام على قبره فأنزل الله {ولا تصل على أحد منهم مات أبدا ولا تقم على قبره}