Yes I think a lot of films have borrowed this type of last minute fright ending.
Event Horizon's was good. You think they're rescued at the end, but the rescuers are demons. That's shown to be imaginary/ a dream, as the real rescuers turn up. But even then the film leaves you with the...