In G.I. Joe, assignment to Toxo-Viper duty in Cobra is a punishment for poor performance. Since Toxo-Vipers work with hazardous materials and the suits aren't airtight as a cost-saving measure (earning them the nickname "Leaky Suit Brigade"), anyone who receives the punishment is unlikely to slack off or screw up again.
Also, dropouts from the normal Viper program are sent to the desert as Desert Scorpions. Desert Scorpions who mess up are naturally put on Toxo-Viper duty.
In Marvel's G.I. Joe comics, washouts from the Joe training program would be transferred to Thule, Greenland or Fez, Morocco. Whether this was to stop them talking about details of the training or to dissuade those who were unsuitable from applying in the first place isn't clear. Although given just how epically it sucks to be assigned to Thule, it was likely the latter.
In Adventures In The Rifle Brigade, Gestapo captain Venkschaft is sent to the Russian front with the rank of Cocksucker Third Class after throwing a fit and calling Hitler a "one-balled twat" over the phone.
In Daredevil, the doctor who authorized the release of the Daredevil impostor hired by the Kingpin from the insane asylum is forced to work in Florida. As a gardener.
In Astérix in Corsica it's established that the vast majority of the Romans stationed in the titular island were transferred there as a means of punishment. The only people there who don't fall into this category are the naive, over-eager and aptly named Legionary Courtingdisastus (who volunteered to go to Corsica due to "good chances of promotion", an action which makes the men he's later given command of think he's completely insane), a Corsican that hit his head and joined the Roman Army and (probably), the governor's crack troops.
A Legionary to other: "They give me a choice between being reassigned here and death penalty, but you know the army: you choose a thing and they give you the other".
The very first book (Asterix the Gaul) ends with Caesar learning that the centurion of Compendium had plotted to overthrow him after getting the gaul's magical potion. He then decides to send him and his men to "Outer Mongolia, I hear there's a barbarian rebellion there".
In Asterix and the Chieftain's Shield, after the heroes beat Caesar to the titular shield, the latter decides to cover up his defeat by sending the troops looking for it to a garrison in Numidia and promotes an uninvolved Centurion and Legionary who just happened to drunkenly stumble by to Tribune and Centurion respectively.
In the film Asterix vs Caesar, a recently transferred in junior officer sends out a patrol, in which he captures Chief Vitalstatistix's niece Panacea and her fiancé. Said officer thinks that this action will help force the Gauls into capitulation. The commander thinks that it will just provoke them into leveling the camp. He promptly transfers the young officer to a distant outpost in the Sahara, shortly before the Gauls arrive.
The title character of Fell finds himself reassigned to the hellhole of Snowtown as a result of, well, something we don't know yet. It's implied that this is actually due to calling in a favor, which suggests that whatever it was he did it should've put him off the force altogether.
Happened to several characters in Judge Dredd in the aftermath of the anti-mutant laws being repealed:
Chief Judge Hershey came under intense public criticism, and was forced to call an election. Dan Francisco was elected new Chief Judge, and reassigned Hershey to an off-world position.
Faced with tensions between norms and mutants, Francisco, influenced by Deputy Chief Judge Martin Sinfield, set up four ghettos in the Cursed Earth to provide food for Mega-City One. Dredd himself was assigned to oversee these in order to keep him from causing any more trouble.
Sinfield sent Judge Rico to aid Dredd after refusing to approve his (Sinfield's) clone's application to become a Judge.
Everyone sent to The Pit during McGruder's second reign as Chief Judge.
Can happen to judges who fail fitness tests, which is an assessment by a senior judge upon returning to duty after an injury. Failing can result in the judge being demoted to traffic, admin or worse.
The original trio of ABC Warriors were all assigned to the elite combat unit as a punishment; Happy Shrapnel had finally worn out all the good will he earned as one of the Wolgan War's oldest soldiers by repeatedly looting and brawling, Hammerstein is said to have murdered a human superior, and the details of Joe Pineapples' situation are classified.
In The Desert Peach, the regiment Pfirsig Rommel commands consists of the people Nazi Germany cannot just remove from duty (or, in some cases, toss in prison or a concentration camp) for whatever reason, but who are too politically embarrassing, too woefully incompetent, or in some cases, too bugfuck crazy to actually get them involved in the actual war.
The Black Panther's State Department ally is reassigned to the arctic, probably because he befriended the man when the USA didn't like him or his country. Being a friend of Wakanda just means you get picked up in a ship when you get in trouble. Hurray!
Knights of the Dinner Table: When Hard 8 reinstates Nitro's GM credentials, it is with the provisio that he is only allowed to GM the Pee Wee Hackleague.
PBI agent Flagstarr, from Paperinik New Adventures, uses this as a threat for failure. She doesn't go through with it... for that specific failure. A mook who screwed up way more discovered it the hard way.
And leave your Bermuda shorts at home. You won't need them in Alaska.
In the Star Wars Expanded Universe, Imperial ace pilot Soontir Fel is punitively transferred to the 181st Imperial Fighter Wing, nicknamed the "One-Eighty Worst". However he promptly gets to work whipping the unit into shape, and by the time he's through, it's turned into one of the best Imperial squadrons in the galaxy.
Blake and Mortimer. A literal version in "The Sarcophagi of the Sixth Continent". Blake has an Oh Crap! moment when he strays into a Soviet base in Antarctica, and is identified by a Soviet officer he defeated in a previous adventure, who was sent to the South Pole for that cock-up.