The act of being stripped of rank or stripped of command was a form of discipline or punishment deemed more severe than a demotion. While a demotion was the reduction in rank, to be completely stripped of rank was to lose all privileges of rank whatsoever.
In 2256, Michael Burnham was stripped of rank at a court martial as part of a criminal sentence for mutiny, which had resulted in the Battle of the Binary Stars and the subsequent Federation-Klingon War, as well as causing the death of Captain Philippa Georgiou and the abandonment of the USS Shenzhou. (DIS: "Battle at the Binary Stars") Her rank was restored upon being pardoned due to her role in ending the war. (DIS: "Will You Take My Hand?")
In 2370, Jean-Luc Picard revealed to the Ferengi Tol that the disgraced Bok was no longer a DaiMon because he had in fact been stripped of command. According to Bok, "They had no right to do that to me." (TNG: "Bloodlines")
Later that year, in one of Elim Garak's many fictitious backstories told to Julian Bashir, he explained that he had destroyed a shuttle, as ordered, but "Unfortunately as it turned out, one of the passengers on the shuttle was the daughter of a prominent military official. I was stripped of my rank and commission, and exiled from Cardassia." (DS9: "The Wire")
In 2373, when Worf and his brother Kurn infiltrated the IKS Drovana, the two were confronted by an inquisitive lieutenant. Worf, who was posing as Commander Sorval, threatened the officer to "leave us, or I shall have you stripped of rank and sent home in a transport." (DS9: "Sons of Mogh")
In 2376, Kathryn Janeway punished the former crew of the USS Equinox with the following dressing down: "The last time we welcomed you aboard, you took advantage of our trust. You betrayed this crew. I won't make that mistake again. Noah Lessing, Marla Gilmore, James Morrow, Brian Sofin, Angelo Tassoni, you are hereby stripped of rank. You'll be expected to serve as crewmen on this vessel. Your privileges will be limited, and you'll serve under close supervision for as long as I deem fit. This time, you'll have to earn our trust. Dismissed." (VOY: "Equinox, Part II")