In the novel Geek Love by Katherine Dunn, the "Bag Man" is a guy who tried to commit suicide but ended up shooting most of his face off. He wears some kind of covering over his face, hence the name.
In Spenser's The Faerie Queene, the character Despair tries to kill himself over and over and it never works. Believe it or not, this is really creepy.
In the Heralds of Valdemar series, Vanyel tries to kill himself in the chapel where his dead love Tylendel is laid out pre-burial. Yfandes raises the alarm in time for rescuers to save Vanyel's life, aided by the fact that Vanyel "didn't know the right way to slit his wrists".
In Sometimes a Great Notion, Leland is introduced with one of these. As he explains later, he was lying in bed waiting for his house to fill with the gas he'd turned on in the kitchen, when he suddenly decides to have a cigarette. The house explodes, but Leland is miraculously unharmed, and he finds a letter from his brother (along with an understandably confused postman) on what's left of his front porch and decides that he might as well return home and help his family fill their logging quota.
In Duma Key, this is Wireman's story. After his wife and daughter died, he decided to shoot himself in the head and actually went through with it. Instead of killing him, the bullet lodged in his brain, causing him trouble later.
In Stephen King's story, "Hearts in Atlantis", a college student who is freaking out about the possibility of flunking out and getting drafted tries to OD on baby aspirin.
A Scanner Darkly: Charles Freck tried to commit suicide by taking a bunch of downers with some wine. He failed and only hallucinated. The hallucination might be a Dying Dream - Freck never appears in the story again either way.
In a very ridiculous scene in Petronius's Satyricon, widely considered to be the first modern novel (written in ancient Rome), one character tries to hang himself off of a bedpost. The post being so low, he fails, but another character comes in and sees him lying there, thinks he's dead, and tries to kill himself with the first knife he grabs, which turns out to be a prop. Hilarity Ensues.
In The Idiot, Ippolit Terentyev attempts to shoot himself in the head, but his gun doesn't fire. Although other characters speculate that he was just Attention Whoring, and that he had deliberately loaded his gun incorrectly.
In the Dresden Files novel Ghost Story, the readers find Harry has done this because he feared becoming a monster as Mab's Winter Knight. So this trope is used in a very convoluted way.
In A Clockwork Orange, the Narrator Alex can't conventionally kill himself because the thought of violence makes him cripplingly ill - the reason he wants to kill himself in the first place. In a moment of sudden desperation he leaps from an apartment window, only to break most of his bones and wind up immobile and unable to talk in the hospital instead of dead. Needless to say, he isn't pleased.
Joanne Greenberg's I Never Promised You A Rose Garden takes place in a mental hospital during the Fifties, from the perspective of teenage inmate Deborah, who was hospitalized after cutting her wrists and bleeding herself out into a basin. Her doctor recognized this as a plea for help, a suicidal gesture, not a true attempt. Another inmate says that "a nut is someone whose noose broke", meaning that failed suicide is a common background for the inmates.
In Jaroslav Hasek's The Good Soldier Švejk Švejk tells a story about a cadet driven to suicide by uncertainty of cadets' official status.note Kadett-Stellvertreter — "cadet officer candidate" — a graduate of an officer school who has just started service in his regiment. They were neither soldiers, nor officers, nor NCOs, thus nobody knew if they should get what soldiers get, or what officers get. As a result they got nothing: no food in the canteen, no blankets in the hospital and so on. As Švejk puts it:
...one of them jumped into the river Malše [...] [but] was fished out again alive. In his excitement when he jumped into it he had forgotten that he knew how to swim and has passed swimming test with honours.
In One Hundred Years of Solitude, Colonel Aureliano Buendía has his personal physician paint a target on his chest right over his heart, intending to shoot himself after signing a peace agreement. After he survives, it turns out the doctor was smart enough to paint the target in a spot where the bullet would miss every single vital organ.
Towards the end of John Marsden's Take My Word For It, Lisa reveals that, some time before the book started, she attempted suicide by overdose, but ended up waking up twenty-four hours later feeling awful, and soon realised that no one in the house had even noticed.
At the end of Madame Bovary, Emma decides to kill herself by swallowing arsenic, expecting this to be Perfect Poison. However, reality doesn't work that way, and she doesn't die until much later, remaining in agony the entire time.
It’s revealed in The Death Cure that Newt tried to kill himself by jumping off one of the Walls some time before Thomas’s arrival. He survived, but broke his leg, hence his permanent limp.
In Another Note, Beyond Birthday uses Self-Immolation as part of his Murder-Suicide plot. He is stopped by Naomi; she doesn't talk him down, but rather blasts him with the fire extinguisher, and gets him medical attention before placing him under arrest. He survives with horrific burns only to later die from a Kira-induced heart attack in prison once he recovers from his injuries.
Tedrin, the villain in Eden Green, is Patient Zero of an alien needle symbiote that keeps him alive no matter how badly he is hurt. He reveals early on that when he was first infected, he attempted suicide using a gunshot to the head... only to have his brain grow back wrong.
Dorothy Parker's 1926 poem "Resumé" alludes to the trope:
Razors pain you; Rivers are damp; Acids stain you; And drugs cause cramp. Guns aren’t lawful; Nooses give; Gas smells awful; You might as well live.
In Le Voyage où il vous plaira (roughly "Travel where you will"), by Alfred de Musset and PJ Stahl, the devil tolds the tale of a man that tried to commit suicide by hanging himself over a river, taking some poison and, for extra security, shooting himself with a pistol... that misses and cuts the rope so he falls onto the river and drinks too much water that makes him thrown up, cleaning the poison from his stomach. Yes, exactly like the infamous Darwin Award.