very true. uncle was a mortician when I was growing up. he told me that there were times just before the embalming process that a body would suddenly sit bolt-upright and he’d have to lay it back down. always made me wonder if a dead person knows they are dead.
From what I have read that the movement in a dead body is a form of rigor mortis. Can start 12 hours after death and last for 12- 24 hours longer. The longevity of the effect can vary based on other factors.