Treasure hunter freed from jail after refusing to turn over shipwreck gold
https://www.bbc.com/news/articles/cg4g7kn99q3o

Treasure hunter freed from jail after refusing to turn over shipwreck gold
Tommy Thompson spent more than a decade in prison after refusing to disclose the whereabouts of 500 missing gold coins.
The real story here is that civil contempt can net you an indefinite prison sentence without a conviction, and if you're lucky a judge will decide to let you out. Over something you may or may not even know.
How else could it possibly work? The justice system depends on judges being able to compel action. Within the guardrails established by the system (e.g. no self-incriminating testimony, if you’re in the US), I don’t have a problem with refusal to e.g. turn over evidence just resulting in detention until you comply. It’s not a prison sentence, since you can get out any time you want.
You ask how else could it possibly work. How about charge him with a crime first, then detain him if he's convicted. The idea that you can imprison someone forever without a charge is insane.
You can't resolve criminal liability without compliance to judicial authority. It's not even a meaningful demand. If you don't trust the judiciary you can't trust any other component of the system!
A jury could have decided whether his refusal to disclose made him guilty of a crime deserving of that punishment. Authority and power are two different things. Lots of people have authority without the power to unilaterally throw people in prison indefinitely.
That's not how court works. It's not a democratic vote of a group of people just making up their own mind. The judge intricately controls what the jury does and does not hear, and how they are instructed, based on the rules of evidence and of criminal or civil procedure. No, you can't just "let the jury decide" if a party to a case simply decides to ignore the judge.
No, that is how it works. If you are charged with criminal contempt, you have the right to a jury trial, and the jury determines whether guilt has been proven to the appropriate standard.