It is permissible to sit near the grave at the time of burial.
It is narrated from Al-Bara’ ibn ‘Azib (may Allah be pleased with him) that he said: We went out with the Messenger of Allah ﷺ to the funeral of a man from the Ansar. We reached the grave, but the niche (lahd) had not yet been dug:
فجلس رسول الله مستقبل القبلة وجلسنا حوله
“So the Messenger of Allah ﷺ sat facing the qiblah, and we also sat around him.”
Reference: Sahih: Sahih Abi Dawud: 2751, Kitab al-Janaiz: Bab al-Julus ‘inda al-Qabr, Abu Dawud: 3212