Nightfall (Series): Myra wishes to leave the Resistance hideout and see the outside world. When it finally happens, she is captured by the enemy.
A Brother's Price: Two women standing outside a building in which their sisters and their husband are. One says to the other: "I wish he was dead" ... the building explodes. Their husband dies, but so does everyone else. They both suffer from survivor's guilt, but it is clear the explosion wasn't supernatural. In fact, it was the horrible husband being Hoist by His Own Petard, he had intended to survive, but was Too Dumb to Live.
A Prayer for Owen Meany: Rev. Merill was at the fateful baseball game in the book when he saw Tabitha wave hi to him. Feeling shameful about the affair he had with her, he wished that she would drop dead. A stray baseball from Owen's bat later...
In the Rudyard Kipling Just So story about Old Man Kangaroo, the title character wants to be very thoroughly run after and different from all the other animals. He got his wish.
In the medieval Chivalric Romance of Robert the Devil and all its variants, the parents wish for a child — whether from God or the Devil. The son is therefore born possessed by evil. (Fortunately for him, in due time, he repents and does penitence for his evil. This results in either marryingthe princess or becoming a saint.)
In Hans Christian Andersen's "The Galoshes of Fortune", the titular shoes grant the wishes of whoever is wearing them. This usually ends badly, as the characters are unaware of their power. For example, the Councilor of Justice held the view that in the time of King Hans, around 1500, everything was better; when the galoshes transport him to that age, he finds out that it was actually much worse.
The Edgar Allan Poe story "Never Bet the Devil Your Head" is an odd case of this. A man tells a story of a friend who says he'd "bet the devil his head" that he could perform a particular trick; out of nowhere, a mystery man shows up eager to take him up on his bet, and sure enough, he manages to decapitate himself and the man runs off with his prize.
In "Wedding Shirts" from A Bouquet of Czech Folktales, a ballad by Karel Jaromír Erben, a woman makes the following wish in a prayer: "O Mary, full of power / Oh, help me at this hour / Bring my beloved home / Lord knows where he does roam / Bring him, I reck not how / Or finish my life now." You know what followed... Her beloved returned to her from the grave, almost leading to the second part of the wish coming true as well.
Both subverted and not in the short story "The Wish Ring". A farmer is kind to an old woman, and gets a wish ring in return. He shows it to a jeweler to see how much it's worth, and the jeweler steals it from him and replaces it with an identical copy. The jeweler then wishes for a million gold pieces, which promptly begin raining from the sky and crush him to death. In the meantime, the farmer goes home still thinking he has the real ring. Every time his wife suggests something they could wish for, he says no, they can work for that and earn it instead. Eventually they become happy and rich because of their hard work, and die with the wish still unasked.
In The Picture of Dorian Gray, the titular character makes a Deal with the Devil to stay young and good looking forever; instead, a life sized portrait of him will age in his place. While he enjoys his life of consequence-free debauchery at first, eventually the picture begins to serve as his conscience, reminding him of things to prefer to forget. Comes complete with a heavy dose of symbolism, as after he commits murder blood appears on his portrait's hands. Eventually, trying to eliminate the portrait and the evidence of his sins causes his own death.
Forms most of the plot of the Edwardian children's novel Five Children and It by E. Nesbit — the "it" of the title is a cantankerous sand-fairy, whose granted wishes always backfire on the children.
W.W. Jacobs's classic short story "The Monkey's Paw" concerns a married couple who receive the title item as a gift from a friend who served in the British Army in India. The paw grants its owner Three Wishes, and the husband uses the first of these to wish for 200 pounds; the couple subsequently learns that their grown son was killed after falling into the machinery at the factory where he worked, and they are offered £200 as compensation from the employers. The wife then begs the husband to wish for the son to be brought back to life; after he does so (with great reluctance), they hear a steady knocking on their door. As the overjoyed wife runs to unlock and open the door, the husband realizes to his horror that the son will have come back in his mutilated state, and quickly uses the third wish; when the wife finally gets the door open, there's nobody there, implying that the third wish was for the son to be returned to the grave.
Also part of the backstory of the Nazgûl: they were once mighty, arrogant Kings of Men who desired power and long life. So Sauron gave them magic rings. Now they are immortal...undead slaves to Sauron's will.
The other Rings of Power save the One Ring acted in a similar fashion. The Dwarven Rings helped the dwarves discover vast riches, feeding and exacerbating their Gold Fever to their detriment. The Elven Rings helped the Elves preserve their way of live, furthering isolating them from the rest of the world. These rings may not have allowed Sauron to control the Dwarves or the Elves to the same extent as Men, but their influence weakened their ability to challenge him.
In The Chronicles of Thomas Covenant: The Land, drinking the Blood of the Earth gives the power to command absolutely anything to happen, but limited human minds simply cannot know all consequences of a sudden change to reality. So it's usually safest not to use it.
In Ursula K. Le Guin's The Lathe of Heaven, the protagonist is repeatedly asked to dream of a solution to a pressing problem, and the solution turns out to be worse than the original. For example, asked to make sure that there is enough food for everyone, he dreams of a plague that has killed most people in the past, and the survivors have enough to eat. Then, he's asked to find a way to avert a threatened global war, so dreams that the nations of the Earth united... against the threat of an alien species that has taken up residence on the Moon. Then, when he is asked to dream that the aliens are no longer on the moon, so he makes them leave the Moon for...Earth.
The basic premise of John Brunner's novel The Traveller in Black is that of a man who grants wishes in ways that are almost never to the wishers' liking; the ultimate goal of which is to replace Chaos with Order. At least, those who are selfish get their comeuppance, but the few who are unselfish (e.g. someone who wishes the Traveller success in his present quest, a little girl who wants to make the fire burn brighter so the family hut will be warm) are rewarded. Moreover, the Traveller often simply accelerates a comeuppance that the character was bound to suffer anyway, as when he splashes Lorega with the transformative water she'd intended to jump into already.
Another work by Brunner, Galactic Consumer Reports 2: Automatic twin-tube wishing machine, states that the machines are "twintube" because the inventor of the machine got killed by a creature it created, so they had to develop a second tube that would moderate the wishes. The story contains many examples of the second tube not quite working as needed, but it's still better than the sometimes sold cheaper one tube machines... apparently, one world is quarantined because a five year old child who wasn't given ice cream got angry, so he used such a machine to create an army of Killer Robots and take over the planet.
Stephen Goldin's short story "The World Where Wishes Worked" is about a world where wishes came true automatically. In this setting, people lived idyllic lives as their every needs were met. Unfortunately, there was a fool, whose wishes were so poorly conceived that they always backfired on him. After making a number of increasingly short-sighted wishes, he finally thought of one that would put an end to this chain of misfortune: he wished "that wishes would no longer automatically come true." The next and final line of the story reads, "Things are tough all over."
In Edward Everett Hale's short story "The Man Without a Country", Philip Nolan, as a young man enamored with Aaron Burr, cries out at his court-martial, "Damn the United States! I wish I may never hear of the United States again!" The court grants him his wish by sentencing him to forever live on ships sailing away from the United States and be forbidden from ever hearing or reading anything about the United States ever again. He comes to really and truly regret his wish, and makes sure to tell the narrator not to make the same mistake he did.
Witch Week by Diana Wynne Jones has Charles use his new-found powers to torment Simon, the classroom bully. How does he do this? With a literal game of Simon says; anything Simon says comes true. After a few mishaps (with Simon saying everything from 'You girls stink' to 'I'm not clever at all!'), Chrestomanci comes in, gets Simon to shut up and tells Charles how horribly everything could've gone if Simon had said something like 'Two plus two equals three' or the like.
Bill Brittain's The Wish Giver is all about this. Three children in a small American town (along with the narrator, a man from the general store who answers to the nickname "Stew Meat") get cards that supposedly grant wishes from a mysterious vendor at the county fair, and the three stories in the book deal with the consequences of the kids' ill-thought-out wishes: A sharp-tongued tomboy named Polly wishes people would start being glad to see her, and much to the amusement of her peers she starts to croak like a bullfrog whenever she starts insulting people; a sentimental girl named Rowena wishes the handsome young traveling salesman she has a crush on would "put down roots in Coven Tree and never leave", and he starts turning into a tree; a farm boy named Adam wishes his family's farm had more than enough water, and it ends up flooded. In the epilogue, the trio have learned their lessons, and beg Stew Meat to undo their wishes with his own wish card.
Another Bill Brittain book, All the Money in the World, has a kid asking a leprechaun for just that. He gets his wish...only to learn that he's unable to spend it, give it away, or otherwise make use of it, because when he tries to do so it boomerangs right back to him. (Also that he's inadvertently bankrupted every nation on Earth.)
Non-supernatural example: In Margaret Atwood's The Handmaid's Tale, the character of Serena Joy is a former conservative televangelist who preached that women belonged in the home and helped to support the overthrow of the United States by the theocratic Republic of Gilead; by the time of the novel, she has been stripped of her public role, reduced to the role of subjugated housewife, and forced to be present while another woman - the Handmaid of the title - has sex with her husband every month. As the latter character wryly notes, "How furious she must be, now that she's been taken at her word."
Along the same lines as The Handmaid's Tale, Sinclair Lewis's It Can't Happen Here details the takeover of the U.S. government by a fascistic regime led by a demagogue named Buzz Windrip. Some characters who initially support Windrip's regime wind up becoming imprisoned or executed by it.
Truth in Television: among the many, many victims of the Nazis were some of the senior members of the Nationalist and Center Parties, which had originally supported Hitler (under the impression that it was him or the Communists, and the Communists were worse.) Windrip isn't quite a Hitler Expy, but Lewis was writing in the 1930s and almost certainly expected his readers to spot the parallels.
Another nonmagical example appears in the Frederik Pohl story "Shaffery Among the Immortals", in which the eponymous protagonist is a fourth-rate "scientist" who desperately wishes to become famous. In the end, one of his useless puttering experiments accidentally creates a mutated form of botulism, AKA "Shaffery's Syndrome" which goes on to kill roughly 95% of the human population, with Shaffery himself being one of the first victims.
In C. J. Cherryh's Russian trilogy (Rusalka, Chernevog, and Yvgenie), wizards work magic by wanting something. Since the form of the wish takes the easiest path, a wish, for example, for the five-year-old wizard's father to not hit him again could and did result in the house burning down and both his parents dying in the fire. Every wish is fraught with the potential for disaster, and not wanting things is like not thinking of elephants, so wizards, by and large, end up insane hermits.
In the first book of Animorphs, Tobias states he's all right with his red-tailed hawk morph and doesn't want to be anything else. Consequently, the end of that episode (and the whole rest of the series) sees him trapped in that shape.
At the start of The Legendsong Saga Glynn wishes for Ember to forget that she is dying. Then when Ember passes through the portal the transition removes all personal memories including this very important warning...
It doesn't quite come true, but there is a scene where Arya (disguised as a servant-girl) is talking to an annoying Frey squire who keeps jabbering about how he's going to marry a princess. At some point Arya just snaps at him, yelling "I wish your princess was dead!" not knowing she just wished her own demise. Averted in some ways in that she's still alive, although whether she's still Arya Stark is questionable.
And also when at the beginning of "A Game of Thrones" Catelyn prayed to the Seven Gods that they let Bran stay in Winterfell. He ended up falling from a tower and not being able to walk ever again.
And at one point, Jeyne Poole remarks about how when she was little, she often dreamed how it would be like to be a Stark. Now she does know for sure - and this involves massive Break the Cutie.
A principal point in the novel Coraline by Neil Gaiman — even used as a tagline in the film. Coraline wants her life to be more interesting, exciting, and engaging... she gets it, but not the way she wants.
One of the characters in Singularity Sky by Charles Stross receives three wishes. His first wish is to be young again; he becomes eight years old. Not quite what he had in mind, but as certain people sought to kill him, he was not going to complain. His second wish is for some "real friends"; he gets some talking animals. His third wish is for adventure. Bad idea.
A running theme in the Tiffany Aching series (the young adult Discworld books):
In The Wee Free Men, Tiffany's baby brother is stolen by the Queen of the Fairies, who will give him whatever he wants - and since he wants sweets, he'll get sweets, and nothing else, for the rest of his life.
That's not even the main problem. He can get as many sweets as he wants and his imagination is a limit... but since he is a little boy, every sweet he is going to eat now means that there is a better sweet in the future he can imagine that he is not eating right now. The end result is a crying boy surrounded by an ever-growing pile of sweets, unable to choose a single one because there is always a better one just beyond his reach.
Tiffany's dream of entering a magical world (the witch school) gets sort of answered by having to visit the nightmarish Fairyland.
In the third book in the series, Wintersmith, Tiffany doesn't want the titular Anthropomorphic Personification of Winter to continue making her name in frost, or icebergs that look like her, but feels sorry and lets him make all the snowflake portraits of her that he wishes. As the story opens with a Flash Forward of the entire Chalk covered in tens of feet of snow, you can see where this is going.
In A Hat Full of Sky, this trope is explicitly dissected, with Granny Weatherwax pointing out that if someone in a story gets three wishes, the third will always be "undo the harm caused by the first two wishes". And in the beginning of the book it's noted that had Tiffany said aloud that she'd like to marry a prince, the Feegles might well show up at her door with an (unconscious) prince and a (tied up) priest ready to perform the ceremony.
There's an example in the main series as well: in Eric, the titular character demands three wishes from Rincewind the wizzard [sic]: mastery over the kingdoms of the world; to meet the most beautiful woman who ever lived; and to live forever. Oh, and a chest of gold. The first wish (granted by Vassenegothrough Rincewind) sends them in orbit above the Disc, and then to one of Eric's new dominions for tribute (the Tezuman empire, the inhabitants of which want to sacrifice them for being a bad landlord, metaphorically speaking). The second wish takes them to the Tsortean Wars, where they meet Elenor of Tsort (an Expy of Helen of Troy), the most beautiful woman who ever lived- ten years and seven children too late. As for the third wish, well, if you want to live for ever, you have to go back to the start of "ever", right?
Also Played for Laughs when it's noted that "yes, but not this bit!" has not been recognised as a valid clause in magic spells ever since the late Funnit the Forgetful's arguably successful spell to destroy the entire tree he was sitting in.
Be careful what you wish for. You never know who's listening- or what.
At the start of Night Watch, a crankier-than-usual Commander Vimes complains about how he never gets to walk a beat anymore and people keep expecting him to employ minorities and take an interest in foreign politics. He's promptly zapped back in time to when the Watch was an all-human gang of layabouts and petty thieves, with the madman Lord Winder as Patrician, and Ankh-Morpork on the verge of bloody revolution. The nostalgia filter wears off fairly quickly.
Common in Jonathan Strange & Mr Norrell, especially when fairies are involved. The Gentleman with the Thistledown Hair even invokes this, as one of his plans for defeating Jonathan Strange is to appear to him and offer him whatever he wants, on the basis that it's bound to cause him trouble. That plan rather backfired when Strange doesn't ask for infinite gold, the most beautiful woman in the world or something distracting and troublesome like that, but instead asks for various lost pieces of information about magic The Gentleman doesn't want him to know, leaving him flustered and trying to convince him to pick something else.
Serwe's backstory in Second Apocalypse has a lot to do with this trope. Her prayers to gods come true several times but not in a way she wants.
Fairy Haven and the Quest for the Wand by Gail Carson Levine. The Neverland fairies get a wand to repay a mermaid, but, unaware that all wands have a mind of their own, accidentally pick one of the meanest wands.
In Death Star, Imperial gunner Tenn Graneet, after Alderaan, remembers his grandfather's saying about being careful what you wish for.
Now he understood exactly what that meant. He had wanted to fire the big gun, and he had gotten to do just that. The only man in the galaxy who had shot it for real, at real targets, and look what it had brought him: misery beyondhisugliest dreams.
Unstated, but in Galaxy of Fear: The Doomsday Ship Zak Arranda, tired from ten books of constant adventure and hazard, just wants to stop and have nothing to do for a while. In the next book, Clones, the family has been on Dantooine for two weeks traveling with a local tribe with anything dangerous being quickly and easily resolved by the adults, and the tech-minded Zak is bored out of his mind.
In Franny Billingsley's Well Wished this trope is the main basis of the plot. The antagonist sets up the protagonist to fall for this trap. She tricks the protagonist into a making wish that she knows will exchange her crippled body for the protagonist's healthy one.
In Melissa Marr's Ink Exchange Leslie wishes for 'no more fear and pain' when she gets her tattoo...she ends up being used as a conduit by some very darkfaeries with a Horror Hunger for negative emotions, unable to feel anything for more than a few seconds and barely lucid.
Mat from The Wheel of Time books is granted three wishes, but doesn't realise it and goes on a rant. Luckily, he manages to get some useful stuff from it.
In The Voyage of the Dawn Treader, one of the seven lords is stranded on an island where all of your dreams come true. When the Dawn Treader arrives there in search of him, they initially think that this sounds pretty good, until poor Lord Rhoop corrects their misconception: not daydreams, dreams. Including nightmares. Once the sailors take a moment to think about some of the dreams they've had, they quickly throw their full efforts into getting the hell out of there.
In The Magician's Nephew, the fruit that Digory picks for Aslan grants wishes. But as the writing on the garden wall warns...
Come in through the gold gates or not at all.
Take of my fruit for others or forbear.
For those who steal or those who climb the wall
Shall find their heart's desire and find despair.
In The Emperor's Winding Sheet by Jill Paton Walsh, the last Emperor of Constantinople said that in his youth he plotted and schemed to become Emperor, and God punished him-by making him Emperor.
At the end of L. Jagi Lamplighter's Prospero in Hell, Miranda reflects on how she had wished to have a common enemy for her family to unite against. She got one. (It's the second in a trilogy.)
Elfsong by Elaine Cunningham includes a stanza from Danilo Thann which says this in the chorus. It's a Bawdy Song. "Your wish bespoke how long it WAS, and not how long 'twould LAST!". And yes, it's about a knight's lance.
One implication of a Cautionary Tale - "A tomboy who became a real boy". A girl wants to do boyish things, and now she has to do boyish things, since she just became a boy.
In Peter Freund's Mysteria series, there is a teenage girl Jessie who, when her father starts a book about the titular land, is excited of it and wants to go there; and then she accidently gets stuck in Mysteria, which is very bad because she requires insulin injections and Mysteria doesn't offer this, even with the magic, so she must find a way back before her supply runs out.
The In Death series: Eve is doing paperwork, which she hates, at the beginning of New York to Dallas. She wishes that there was some murderer out there for her to go get. She gets it in the form of Isaac McQueen, a rapist and pedophile, who was the first murderer she took down while she was in uniform, and is out for Revenge against Eve. It goes From Bad to Worse when Isaac goes to Dallas, the place where she killed her father in self-defense at 8 years old. Paperwork suddenly looks very good right about now.
In The Obsidian Trilogy and The Enduring Flame Trilogy Wildmages can make wishes to the Wildmagic which will grant it for a price which varies depending on the difficulty of the wish. Since the magic will grant you what you ask for, not what you want, Wildmages are warned to think carefully what they really want/desire in order to not waste time and energy paying off a wasted wish, and to minimize the cost of any necessary wishes.
Septimus Heap: Lampshaded with Marcia becoming ExtraOrdinary Wizard, since she wished it all the time and it eventually became true... by Alther being shot on the day she became EOW: "Beware what you wish for, lest it come true"
Jack: I should be able to just stick out my arms, and have a princess fall right into them!
Enchantress from the Stars: Young, overenthusiastic Elana wants to be a part of expedition on Andrecia. She gets her wish when Ilura, another agent, is killed and from then on is on for a very harsh mission from which she now can't back down.
Charlie and the Chocolate Factory: Seemingly every child on planet wants to get one of the five Golden Tickets, which will enable him or her to visit Willy Wonka's factory. For four out of five children who find it — and of these four, at least three actively seek the ticket — the visit turns into a horrible experience. All four are too self-centered to follow their guide's instructions; when faced with something they realize they want badly, they disregard his warnings and pursue it to dreadful ends. This is subverted with The Hero, a virtuous, unselfish kid who becomes the heir to the factory.
Ista: The gods' most savage curses come to us as answers to our own prayers. Prayer is a dangerous business.
This echoes a remark by the Roman writer Juvenal about "monstrous prayers that Heaven in anger grants."
In a 1941 Theodore Sturgeon short story "Shottle Bop", a seer-of-ghosts sees a ghostly couple in an endless feedback loop, repeating a conversation, summed up as follows: "If we kill ourselves, we're sure to be together.... forever.... just like this." "Will we, Tommy?" "I promise.... just like this."
In The ABC Murders, Hercule Poirot says his ideal mystery would be murder at a bridge game, where everyone was so intent upon the game that noone noticed when one of them, the dummy that round, got up and killed the host. A few books later, he faces exactly that.
In E. D. Baker's The Wide-Awake Princess, Sleeping Beauty's parents want to protect their second daughter and assure the Fairy Godmother they would do anything to prevent such a curse on her. The fairy godmother makes her immune to magic. Which means she doesn't get the standard gifts that make her beautiful, talented, charming, etc.
In Airframe, after a strange incident involving a plane, the manufacturer takes it up to recreate it, and a reporter that's been following them demands to go along. She winds up regretting it.
Household Gods by Judith Tarr and Harry Turtledove begins when Nicole, fed up with life in modern-day LA, tells what she believes to be perfectly ordinary statues of the Roman gods Liber and Libera that she wished she could live in ancient Rome. Liber and Libera deem it an excellent request, and are all too happy to grant it.
As John Galt explains towards the end of Atlas Shrugged, society has claimed for decades that wealthy businessmen, executives, and entrepreneurs are evil villains who harm, exploit, and enslave others. Well, he has made them all vanish, liberating society of their evil... so what does anyone have to complain about?
"Be Careful What You Wish For" by Stef already states it in the title. Young girl Gwen is bored and wishes for something to do. She is sent on a quest to save Idlebury kingdom... from itself.
John Collier's short story "The Chaser" applies the principle to a Love Potion. The customer buys it in order to secure the absolute and undying love of the woman he desires, but it's implied that this will eventually grate on him. In fact the chaser of the title is the untraceable poison the shopkeeper is sure he'll be back to purchase. The story was adapted as an episode of The Twilight Zone, and more gruesomely as a Tales from the Cryptstory and episode, "Loved To Death!"
A very sad example happens in Bridge to Terabithia. In the beginning, Jess want to become the fastest runner in his grade, but he is beaten by Leslie. Near the end, he contemplates that now he probably is the fastest runner - because Leslie, who became his best friend during the year, has just died in a tragic accident. Needlessly to say, this wish fulfillment doesn't make him happy.
In The Book of Lost Things a greedy and gluttonous man requests that the Crooked Man pay him in gold the weight of everything that he has eaten at a buffet. The Crooked Man complies...by pouring molten gold down his throat.
In Harry Potter and the Chamber of Secrets, for a good portion of the book, Harry wishes that the other Hogwarts students would stop believing the rumors that he's the Heir of Slytherin. Eventually they do, but only after Hermione gets petrified, causing everyone to realize Harry would never attack one of his best friends if he was the actual culprit.
Cho's finally interested in Harry! Only she won't stop crying about Cedric, she's a Clingy Jealous Girl about Hermione, and her best friend betrays the DA to Umbridge. To make matters worse, as Hermione puts it, Cho's main interest in Harry lies in how he was the last person to see Cedric, her previous boyfriend, alive.
Ron is excited to take the Knight Bus back to Hogwarts after Christmas, claiming that he's always wanted to ride it. After he gets thrown to the floor for the sixth time:
Ron: I've changed my mind. I never want to ride on this thing again.
Throughout much of Harry's fifth year, he wishes that people would believe his claim that Voldemort has returned. At the end of the year, people finally believe him, but since the circumstances that led to people believing him also involve Sirius' death, at this point it doesn't seem so important to him anymore.
Near the start of Harry Potter and the Half-Blood Prince, Harry learns that Snape has at last achieved the post of Defence Against the Dark Arts professor, and is overjoyed that this means that Snape will be gone by the end of the year; he is "keeping [his] fingers crossed for another death". He gets his wish, but it turns out to be Dumbledore who dies, not Snape.
The oldest brother asks for an unbeatable wand to ensure his victory in duel. He wins a duel with it, but when he boasts of the wand in a pub too much later that night, he ends up killed in his sleep by a thief coveting his wand.
The second brother asks for a gift that would reverse death, and Death gives him the Resurrection Stone. He uses it to bring back his fiancee, who died shortly before their marriage was to take place, but it turns out that the dead don't like being brought back to life and he's Driven to Suicide upon realizing that he can't truly be with her in this state.
The Malfoys spent years working for Voldemort's return because he supports their Pure-Blood Supremacy worldview. When he does come back, it results in a long Humiliation Conga for them and almost results in the death of their only child.
For most of his career, Horatio Hornblower really wants financial security (he's terribly unlucky with prize money, which is the real source of a captain's living), recognition of his good work by the Service, and (after The Happy Return) a way to marry Lady Barbara and a title to impress her. He gets all of it at the end of Flying Colours—but because his hero's welcome and title are calculated propaganda, he and Barbara are freed by the death of their spouses, and his constant self-loathing makes him feel like he deserves none of it anyway, Hornblower starts hating it before the last page.
One of the obvious aspects in The Wishing Maiden, as the titular Maiden has no control over how the wishes are granted; it's all in the phrasing, and the phrasing tends to be taken very literally.
In Red Mars, one of the First Hundred colonists on Mars is Arkady Bogdanov, a visionary who dreams of remaking humanity on a new world and craves revolution to escape from the old-fashioned and oppressive political structures on Earth. When the revolution comes in 2061 he's as happy as a clam in his free city. Until, that is, it's sabotaged and immolated by U.N. forces, killing him and hundreds of others. The Revolution of 2061 turns into a total bloodbath as the U.N., now a puppet of "metanational" corporations, hunts down and slaughters as many revolutionaries as it can, locks down control of Mars, and forces the survivors deep into hiding for decades.
In Freaky Friday, Annabel wishes she could be her own boss. She soon is (via being body-swapped with her mother), but finds that there are a lot of things to be considered.
Some form of the phrase is known to just about every culture in the Heralds of Valdemar novels. It gets directly invoked in Bastion, when the headman of a border village decides that they can get along just fine without fancy-pants Heralds showing up with the new laws from Haven — by the time Mags and Jakyr finish pointing out everything they've just "won" along with their freedom (short form: no more Healers, no more Guard, and did I mention this area is known for bandit attacks?) the entire village throws their headman out of office.
This German e-book is literally called Be careful what you wish for. The sentence is never used, but it is pretty obvious that the protagonist wanted to "get some". When he hits on a woman in a rather clumsy and offending way, she calls her big, brawny friend and asks him to get rid of the protagonist. Turns out, the brawny guy is her Gay Best Friend, and abhors violence ... but thinks the protagonist is rather cute, and subtly seduces him. Which exacerbates the problem the protagonist wanted to solve in the first place, namely teenager-typical insecurity. Hilarity Ensues.
Eva Nine, the protagonist of WondLa, has a longing desire to explore the outside world at the start of the first book, since she is stuck in an underground Sanctuary with her mother figure aptly named MUTHR. In the fourth chapter of the first book, the Sanctuary is attacked by a hostile assailant, forcing Eva to enter her greatest dream and her worst nightmare mashed into one: having to go above ground to safety by herself .
Discussed by Hazel and Augustus in The Fault in Our Stars; Hazel had used her wish to go to Disney World and Epcot, but Augustus saved his wish in case he could think of something more meaningful. He eventually uses it on a trip to Amsterdam with Hazel to meet Peter van Houten.
In Dora Wilk Series, three girls in Toadies jokingly wished for their exes to become animals that represent them best. To their horror, not only this worked, but it turns out that turning muggles into animals is considered a serious crime - fifteen years of community work is considered getting away lightly.
In The Hitchhiker's Guide to the Galaxy, Earthman Arthur Dent has a throwaway line in which he wishes he could have a daughter so he could tell her not to marry a Vogon (a particularly unpleasant alien race whose representatives blow up the Earth). Later on in the series, he finds he has to make donations to sperm banks in order to make money to survive on his travels... only for Trillian, the one other (female) survivor of Earth deciding she wants a kid, producing the troubled and somewhat rebellious Random, who ultimately gets unceremoniously dumped on her unsuspecting father due to her mother's hectic new lifestyle as an intergalactic reporter. Whilst the books and radio series pass over this fact unceremoniously, the stage adaptation makes mention of it: needless to say, Random needs no convincing and rudely dismisses the very possibility.
In A Land Fit for Heroes, the demon-gods of the Dark Court listen to the prayers of their followers, and occasionally grant them. It is thus not uncommon for people to end up regretting that they got what they wished for.
Takavach: Here's a young man — quite a number of young men in fact — all dreaming of battling monsters out of Skaranak legend, praying fervently for some opportunity to test their heroic mettle. Wolves, steppe ghouls, flapping wraiths, it really doesn't matter which, their prayers are vague — as long as it's a monster, bring it on. Well, we choose one of these idiots and we answer his prayers.
The Saga of the Greenlanders: When Thorvald Eriksson and his companions discover and explore a wooded headland, Thorvald likes the spot and says that he would like to make his home there. A little later they are attacked by natives, and Thorvald gets a deadly wound from an arrow. Before he dies, he advises his companions to bury him on the headland, and remarks that his wish did indeed come true: he will stay on the headland.
Orkneyinga Saga: When drinking in Jarl Paul's hall, Paul's retainer Svein Breast-Rope feels so insulted by a minor taunt of Svein Asleifarson, he mutters to himself "Svein will kill Svein, and Svein shall kill Svein". Eyvind, another retainer, hears it and warns Svein Asleifarson. Svein Asleifarson decides to not wait for the other Svein's initiative, and thus Svein Breast-Rope's words come true—though naturally not the way he intended them.
In Summer in Orcus, Summer is told a story about a woman who wished to be a dragon, only to find that her dragon body's instincts were stronger than her human willpower and she was unable to stop herself going on a rampage that destroyed her home city and everyone in it.
Elder God K'rul from the Malazan Book of the Fallen has a penchant of giving too freely, even powerful things that should not be trifled with. The first thing the Tiste do with his newly-created magic system in the prequel The Kharkanas Trilogy is to exploit it to see how many people they can kill with it. K'rul just wanted equal opportunity magic for all.
Survivor Dogs: A Pack Divided: Whisper is grateful to Storm for saving him and his pack from Terror, but he ends up being too attached to her. Irritated, she snaps at him to go away and leave her alone. When Whisper ends up killed near the end of the book, she tells herself regretfully that she got her wish, all right.
Iben's backstory in The Girl from the Miracles District. Iben used to be a mortal man married to an immortal huldra. As he was aging, he realized he can't stay with her for much longer, so when Frigg offered him a wish, he asked to become immortal as well so that he might spend eternity with his wife. Unfortunately for him, huldra are only allowed to bind themselves to mortals, so now she can't stay with him for longer than a few days before she has to leave for weeks or even months on end.
comes up multiple times in The Locksmith, starting with a wish for adventure getting the protagonist in to hazardous situations, and latter a wish that a wizard who knows and appreciates what I am would show me he loves me. Id even cut off my hair for that that does among other things cost Lucinda her hair.
The Nightwatcher, from The Stormlight Archive actually defies this. She'll happily grant the wish of whoever comes asking, but always balances it out with a corresponding curse. While said curse can manifest as a horrible twist on the wish, it just as often doesn't. You tell her what you want, and she gives what she thinks you deserve, and she'll make sure you know that before letting you make your wish.
In Paradox Bound, Zeke is confronted by Fifteen for allowing Eli to get out of town, despite being specifically told to keep an eye on him. Trying to defend himself, Zeke says that he would've done a better job if he'd had more information. Fifteen thinks about that for a moment, then decides he's right. Then he knocks Zeke out and takes him back to his HQ, so that Zeke can be turned into one of the Faceless Men. Since all Faceless Men are always certain of everything around them within the range of 200-300 feet, Zeke (well, Zero now) gets his wish.
Silk offers Adam a single wish for stopping the Composer. He decides to sit on it instead of immediately cashing it in, and Laura notes that any wish she grants is liable to have some kind of trick hidden within.
In the finale, Silk offers a boon to Laura in exchange for Derek's body. Laura claims that Adam didn't get a good boon, but Silk insists that he got exactly what he wanted and is satisfied. Derek accepts the deal, but Laura decides to wait before cashing it in.
In The Wish, Wilma Sturtz is given a wish and asks to be the most popular student at her middle school, Claverford... only to discover the effects only affect students of Claverford, it has no effect to students who are outside or not attending Claverford, and that it will expire the second she graduates.
In Half Magic, a group of children find a magic coin that grants unlimited wishes. The catch is that it grants only half-wishes (ex: wishing to be invisible makes you appear half-translucent). It also grants not only wishes that are spoken out loud but wishes that are merely thought of. The children quickly learn to be very careful with wording their wishes, but they still get into various mishaps until they make a final Selfless Wish for their mother and leave the coin to be found by a needy family.
In Speak, Heather wishes to become a member of the Marthas, the most popular clique in school. She works hard to prove that she can commit to their volunteer projects, and even goes as far as to leave behind her less popular friend, Melinda, in hopes that it will make her look better. She eventually becomes a Martha like she wanted, but their expectations turn out to be too much for her. The Senior Marthas boss her around constantly and treat her like a servant. She's forced to spend so much time on their volunteer projects that she can't keep up with her schoolwork and her grades are going down. When she's given a huge Martha project that she's expected to complete by herself (decorating a hotel ballroom for the senior prom), she completely fails it, with everyone complaining that she did a terrible job. Melinda snarks that she should run away and join the Marines, because they'll be kinder to her than a swarm of angry Marthas. Oh, and when she realizes (way too late) that Melinda was more of a friend to her than the Marthas ever were, and tries to go back to her? Melinda slams the door in her face, because she's already seen exactly what kind of person Heather is and wants nothing more to do with her.
In The Chocolate Touch, John wishes that he could eat all the chocolate he wanted after his parents cut him off. He goes to a candy store that he'd never seen before and buys a box of chocolates, which he eats before going to sleep that night, and discovers the next morning that everything he touches with his lips turns to chocolate. He's ecstatic at first... until he starts experiencing the downside.