For example, if something is established early on in a story but is contradicted by something else later on, almost as if the detail was forgotten.
If a character puts something down on a table in one scene, but picks it up again from a counter in another scene, that's a continuity error.
In fiction, continuity is consistency of the characteristics of people, plot, objects, and places seen by the reader or viewer over some period of time. It is relevant to several media.
Continuity is particularly a concern in the production of film and television due to the difficulty of rectifying an error in continuity after shooting has wrapped up. It also applies to other art forms, including novels, comics, and video games, though usually on a smaller scale. It also applies to fiction used by persons, corporations, and governments in the public eye. …
Most continuity errors are subtle and minor, such as changes in the level of drink in a character's glass or the length of a cigarette, and can be permitted with relative indifference even to the final cut. Others can be more noticeable, such as sudden drastic changes in appearance of a character. Such errors in continuity can ruin the illusion of realism and affect suspension of disbelief. …
The article goes on to list several specific types of continuity errors, such as visual errors, plot errors, Homeric nods, and aging discrepancies. With respect to this question specifically, it seems what you're looking for is a plot error.
Sometimes, continuity errors can be introduced deliberately, such as when a character in a piece of fiction is meant to notice something that's out of place.