|WARNING! This article contains MAJOR spoilers for the recently released novel Collateral Damage. Caution is advised.|
Courts martial were called in order to examine the conduct of a Starfleet Captain when a starship is lost. (Note: Lost refers to literal "misplacement" of the starship, when it has been abandoned and its destruction cannot be confirmed.) (TNG novel: The Buried Age).
In 2269, Janice Lester (while inhabiting Kirk's body) declared Spock and Lester (actually Kirk inhabiuting her body) mutineers and had a summary court martial in which they, alongside Leonard McCoy and Montgomery Scott, were sentenced to death. This order was never carried out. (TOS episode: "Turnabout Intruder")
After Section 31 was exposed to the public and knowledge of the forced removal of Min Zife became public knowledge, Captain Picard returned to Earth to subject himself to legal process for his role in Zife's removal from office. An article 32 hearing was held to determine if Picard should be court martialed, however after reviewing evidence and testimony the presiding Admiral Marin Liu recommended that Picard not face a court martial. Liu did however enter a reprimand in Picard's record that ended any possibility of further promotion for him. (TNG novel: Collateral Damage)