An old theme - reminds me of the Leslie Howard 1930’s film Outward Bound (remade several times after that) of a shipful of travelers who don’t realize they’re dead and are “outward bound”.
Good call. Similar plot.
The Others also used a similar plot twist.