Jami` at-Tirmidhi Book 10, Hadith 81
The Prophet said: "The Lahd is for us and the hole is for other than us."
"The Messenger of Allah (ﷺ) stood, then (later) he sat". (Sahih)
There are narrations on this topic from Al-Hasan bin 'Ali, and Ibn 'Abbas.
Abu Eisa said: The Hadith of 'Ali is a Hasan Sahih Hadith, regarding which there are narrations from four of the Tabi'in narrating it from each other. This is acted upon according to some of the people of knowledge. Ash-Shafi'i said: "This is the most correct thing on this topic" This Hadith abrogates first Hadith: "Whenever you see a funeral (procession), stand up ."
Ahmad said: "If he wants, he stands, and if he wants, he does not stand." His proof is that it has been reported that the Prophet (ﷺ) stood, then sat, and this is what Ishaq bin Ibrahim said.
(Abu Eisa said:) As for the saying of 'Ali: The Prophet (ﷺ) stood for the funeral and then sat, he means that the Prophet (ﷺ) would stand when he saw a funeral (procession), then he did not do so later, so he would not stand when he saw the funeral (procession).
"When he Prophet put the deceased in the grave" He said: And Abu Khalid (one of the narrators) said : "When he placed the deceased in the Lahd" - "He said one time: 'In the Name of Allah, by His command and upon the Millah of the Messenger of Allah.' and one time he said: 'In the Name of Allah, by His command and upon the Sunnah of the Messenger of Allah."