I have a few ways of dealing with bad dwarves, my favorite ways are simple.
Firstly, just a really deep hole, and a lever supported just by a support, access only over a grate(Which won't support anything. The lever is set to the support, assign the lever to be pulled by the bad dwarf, usually a noble.
Pros:
Quick to build once you already have a hole, or anything that is lethal for a dwarf to be dropped into, like magma, pit of untamed animals, chasm, or just dumping them outside during a siege.
Almost 100% success rate.
Cons:
Takes 3 mechanisms each use, and 2 building material of choice.
Small and boring
Dust may pull other nearby dwarves into the hole.
Does not kill the dwarf's pets
A single pump at the edge of the magma pipe/pool, no walls or anything. The dwarf is either set to pump it, or called close to it by lever in case of nobles.
The pump will pump up the magma, which will flow back to the magma source, causing burns and magma coverings. The dwarves will die a slow, magma-related death.
Pros:
Just takes a pump, magma safe materials not needed, but recommended if it's going to be re-used.
If the magma doesn't kill them, the fire imps or magma creatures most likely will.
Gets rid of the pets too.
Cheap and fast.
Magma.
Cons:
They may run back into your fort. While burning.(Get a locked door)
Other dwarves may try to rescue or bury the burning dwarves(Locked. Door.)
No clothes to sell after death.
Needs someone to operate the pump in case of a noble.(Or a lever connected to a power source and the pump, which costs time and resources)