The 2006 film The Prestige begins with a magician drowning while performing a magic trick, with another man accused of murdering him. During the trial, the magician's engineer is asked to reveal the secrets of the trick where the magician died. He is reluctant to do so.
Cutter: If I reveal my magician's secrets here in open court, I'll be unemployable and the secrets will be worthless. The Real Transported Man is the most sought-after illusion in the business and I have the right to sell it on.
Judge: Mr. Cutter, I see your predicament, but we are talking about a capital offence; Alfred Borden's life hangs in the balance.
If you were prepared to disclose the details to me in private, I might be able to judge their relevance to the case. Might this be an acceptable compromise?
Is this something that could happen in a real court session? I don't think there was a jury in this trial, but would that change the answer? If it matters, the movie takes place in 1900s London.