Twist Endings are very popular in certain genres, but they are not easy to create. Many writers make the mistake of creating a shocking ending without giving hints to the ending--the reader, therefore, is blindsided and simply confused, as opposed to kicking themselves, saying "Aww, I should have known that!"
In the film, The Orphan, we see a sinister adopted girl try to kill her family members. However, at the end of the film when we discover she is a thirty-three year old woman with a stunted growth problem, who pretends to be a child to destroy families, we are completely confused and blindsided. There were small "hints" throughout the movie (like her use of profanity) but that was barely a hint toward the completely outlandish ending. Something like her getting her period in the bed at a strangely early age, or being discovered shaving her legs, would have been more effective.
Meanwhile, in Harry Potter and the Sorcerer's Stone, we don't suspect at first that Harry's professor is embodying Voldemort. But when we discover it at the end, we are not completely surprised, given that the professor has been strange around Harry throughout the book, specifically not allowing him to touch him.