Verily, the Prophet ﷺ used to stand first but later on kept sitting; but it is also narrated that Nafi' ibn Jubair saw Waqid b. 'Amr standing for a bier till it was placed down.
شَأْنِ الْجَنَائِزِ إِنَّ رَسُولَ اللَّهِ ﷺ قَامَ ثُمَّ قَعَدَ وَإِنَّمَا حَدَّثَ بِذَلِكَ لأَنَّ نَافِعَ بْنَ جُبَيْرٍ رَأَى وَاقِدَ بْنَ عَمْرٍو قَامَ حَتَّى وُضِعَتِ الْجَنَازَةُ