What about Scotty in TNG's "Relics" and in "Generations"? In "Relics", after he rematerialized and here's about the Enterprise, he assumes that Captain Kirk has taken her out of retirement, but in "Generations", he not only is a guest on a new Enterprise under a new captain, but also witnesses (as best as possible, anyway) the "death" of Kirk.
Everyone who has replied to this has looked at it from Scotty's point of view while most continuity errors are looked at as something the show did wrong. Well, Relics came out in 1992 and Generations came out in 1994. From the TV show's standpoint, Kirk was still alive. If the dates were reversed then there would be a continuity error.
The order in which the stories were created doesn't change the fact there is a continuity error. From a continiuty standpoint Doohan shouldn't have been asked to reprise his role of Scotty in
Generations because of what "Relics" established (Kirk was alive when Scotty was placed in stasis) Of course because of factors Doohan did get a part in
Generations, continuity be damned! Interesting to note that "Relics" and
Generations were both written by Ron Moore.