The poor representation in this movie reminds me that there have been a few of books that I’ve read recently that examine trauma as power or as a gateway to power
The first that comes to mind is Brandon Sanderson and his Mistborn and Stormlight books, which require some amount of spiritual damage in order to access magic. Sanderson himself is a devout Mormon, and has written a world where bodies literally have a physical, cognitive, and spiritual aspect. Sanderson has explained this as magic seeping through the “spiritual wounds/scars” and seeking to fill the damage left by the trauma. He’s generally handled this much better than Shyamalan, but I still have some issues with parts of his work.
Next, Lev Grossman’s The Magicians. Often (improperly imo) called “adult harry potter” The Magicians is a book about a young well off functionally depressed teen becoming a Magician, and painfully learning over the course of 3 books that if you learn magic you become a depressed magician. I’m skipping over a huge part of the plot, but at one point it is mentioned that everyone at the school is depressed/mentally unwell in some way, and only flawed people can do magic. While the series doesn’t handle that aspect particularly well, it does heavily revolve around trauma and does an okay job talking about it.
Finally the best is Worm by Wildbow. Worm is a superhero web-serial based around the idea that during extreme trauma, you have the chance to develop powers that directly reflect the types of trauma you endured. Unlike most of these other depictions, it doesn’t suggest that this is good for the people who have been traumatized. Most who experience this end up living with representations of their worst periods of their lives, and turns out that’s bad. Smart characterization and tight(ish) pacing make it one of the best representations of this trope that I’ve read.