Yes I do have a case study in mind (with data) that I'll go into sometime this week, but this post will motivate the idea.
Looking back on history, we notice examples of scapegoating, witch hunts, irrational panics, or whatever you want to call them. A group of people are singled out for suspicion, have their reputations dragged through the mud, are held captive during the trial, and may suffer physical punishment if found guilty. However, it turns out that they did not do any such thing that they're being accused of. Sometimes this lack of blame is discovered during the trial; sometimes not until after their punishment.
With the benefit of hindsight, the trial looks like a complete waste -- a wild goose chase, only one that harms innocent bystanders. Still, there is a positive deterrent effect worth considering, whereby those who are truly carrying out the bad acts that the accused are on trial for get freaked out by the threat of mob vengeance and dial down their evil. Not exclusive to that possibility, seeing the fiery indignation of such a crowd of people might cause them to reflect on their acts, see that they are wicked, and dial them down out of shame. Obviously the second cause can only work on non-sociopaths. How the deterrent effect and the unjust accusation effect compare in size is an empirical question that can only be looked at case by case.
The basic way to see the witch hunt is as a display that the community has lowered its threshold for bringing serious accusations, for deciding that the accused is guilty, and for meting out harsh punishments. Or looked at another way, it shows that the deciders of guilt and punishment have increased their trust in the accusers, and decreased their trust in the accused.
This lowered threshold will result in a greater rate of false positives than before -- where an innocent person is judged guilty. However, with a higher false positive rate comes a lower false negative rate -- now there will be fewer cases where a guilty person is judged not guilty. If even the not-guilty have become more likely to be judged guilty, then certainly those who truly do have a closet full of skeletons will be less likely to escape a guilty verdict after being put through the same witch hunt process.
In the perhaps bogus formulation of economists, the witch hunt atmosphere raises the expected costs to the those who are actually doing whatever the unfairly hounded group has been accused of. This greater cost has two components. First, the atmosphere raises the probability of getting caught for the guilty. And second, since the crowd is now rabid, the size of the punishment dealt to those judged guilty has shot up. "Rats, if even those clearly harmless people are having their feet held to the fire, it's only a matter of time before I'm found out, and with the state they're in, I'll be lucky to be killed quick."
As for feeling shame, something similar applies. The shame that comes from a realization of how others feel about your acts (or would feel, once they were aware) can be broken down into two pieces. First, the probability that a random person in your area or social circle would join an indignant mob tells an onlooker how much confirmation there is that the act is wicked -- if hardly anyone is joining in, it's only a fringe group trying to push their morality on the majority, but if lots more are joining in, they can't all be stupid or crazy. Second, the intensity of the indignation leveled at the alleged act tells an onlooker how certain that member of the mob is that the act is evil -- nobody goes around spewing bile over a trivial moral infraction.
So, the greater the size of the mob, and the more fire-breathing they are, the more shame a spectator would feel who had been doing whatever the accused is being tried for. "Jeez, I never realized that so many people felt so repulsed by those kind of things, which I've been doing myself -- they're probably right, I had better knock it off."
Again, how this deterrent effect stacks up against the unjust accusation effect can only be looked at case by case. If many innocents are judged guilty and subjected to harsh punishments (torture, long prison sentences, death), while there are only a handful of not-so-harmful crimes prevented through deterrence, it's a waste. But other cases may involve a small number of innocents who are ultimately judged not guilty, though not without having their reputations slandered and being confined during the trial, and where large numbers of really sick crimes are deterred by the spectacle.
There is no big red button for us to push -- should we make a certain trade-off or not? -- because we never know during the lead-up to the trial (or to its abandonment) what the costs of unjust accusations will be and what will be the benefits of deterrence. In certain circumstances, these trials appear to be unavoidable, so there's no button in that sense either. Yet in evaluating the trial afterwards, in addition to adding up the costs of the unjustly accused, we should also not forget to tally the benefits of crimes that never happened because the would-be criminals thought twice after witnessing the crowd all but devour someone who was, in the mob's eyes, just like them.
We rarely see these crises-that-were-prevented in the data, but that doesn't mean they're not there. Indeed, because there was a much higher rate of false positives during a period of witch-hunting, it follows that there was a lower rate of false negatives -- a lower rate of letting the bad guys walk free and unmolested.
And like it or not, it's the sheer size and ferocity of the crowd that is responsible for the deterrence, whether through raising costs or inducing shame: a single judge, or handful of judges in the criminal's region, issuing a dispassionate notice that the court has become more trusting of accusers and less trusting of the accused would not have the same effect. For all the criminally inclined onlookers can tell, such a display reflects only the views of a fringe and even they don't hold the view very strongly. This is not to glorify the mob atmosphere as such, but only to note descriptively that it can pack a punch that officials of law enforcement and the courts cannot.