I didn’t take this as a twist ending – i.e., I don’t think it was really supposed to surprise the audience, or anybody but the main character, really, though some trailer folks might have felt differently. Ultimately, it’s not a mystery thriller with a shocking revelation or anything like that, it’s a film about the human condition, how we treat each other and why, man’s inhumanity to man and to himself, the constructs we create and call reality to justify (or, as the case may be, conceal) our actions and behaviour.
It calls into question the concept of mental health, or our idea thereof – that those in possession of it are reasonable individuals in control of themselves, and those that have lost it are overcome by some external force, controlled by their illness, when in reality, even the healthy are far less in control than they’d like to believe themselves to be. Like being fit and healthy doesn’t always help you when your boat’s being rocked by a storm.
Losing one’s sanity is one of those things that we can only ever imagine happening to other people, largely because we imagine that a person not in possession of all their mental faculties is something fundamentally different from a person that’s got their wits together, i.e. us; that, in order to loose our mind, we’d have to become a totally different person, and then, in a way, it wouldn’t be us anymore. We would no longer be ourselves if wrapped in a fundamentally reality-denying delusion, so it can’t happen to us. The thing is, that’s wrong, and that’s what the movie showed, and masterfully in almost every detail (except for the anagram thing – that’s just a trite cliché, and I really don’t think any massively delusional person would construct word games involving their ‘actual’ life; Kingsley’s character pulling out the whiteboard to make the point felt jarring, too).
In a way, though, you probably could say that the very last line from DiCaprio’s character constitutes something much more like an actual twist – as it does actually subvert the theme of the movie by showing a possible way of, not quite redemption or atonement, but a re-taking of control and a re-assertion of the character’s humanity in spite of the domineering force of mental illness.