Many of the Sherlock Holmes stories involve surprise endings, so you could pick just about any of the stories as an example of this. I will use, as my example, "The Man with the Twisted Lip." In this case, the major twist is that the man who has been arrested for a murder is actually the supposed victim of the crime.
In this story, Neville St. Clair has gone missing in a very seedy part of town. A horribly disfigured beggar is suspected of killing him because St. Clair was last seen (by his wife) at the window of the place where the beggar lived. Blood was later found on the window sill where she had seen him.
As it turns out, St. Clair was the beggar. He made good money that way but did not want people to know that was how he made his living. That is a definite twist/surprise ending.