Directors such as Hideo Kojima and David Cage practically made their names crafting dense, intellectual, surprising stories that didn't treat the player like an idiot, really authoring the game around storytelling and using that investment to deliver genuinely jaw-dropping twists and turns along the way.
Even better, because you spend way more time with characters in games than you do in movies and even TV, it makes it all the more surprising when the rug is pulled out from under you.
Of course, executing this successfully is an art form in and of itself. Having grand ambitions to deliver a huge twist is all well and good, but the potential for failure is huge, and if a player guesses where the plot is going too early, it can ruin the entire experience.
These shocks need to be earned, and that means putting in the legwork throughout the entire story, rather than hastily throwing something in at the end and hoping players don't realise it doesn't make any sense. Fortunately, when this is done properly, it results in plot twists that were actually subtly telegraphed way before they happened.