Most criminals who are locked up as a punishment or to await trial are just confined in regular cellblocks or jails, but not all of them. Some are so dangerous that ordinary prisons just will not hold them. Others have secrets that cannot be allowed to be spread, or their crimes are so dreadful that they deserve a greater punishment then normal incarceration or even execution. In yet other cases the ruler had a nasty sense of humour...
In a city where the justice system features judicial dueling, plaintiffs and defendants are permitted to request a champion to take their place in the duel: Someone chosen by lot from among the foreigners in the city. When anyone first arrives, they are given an enchanted ceramic pendant that marks them as a candidate for "court duty".
Wealthy folk entering the city are often escorted by burly guards, paid to carry pendants on their behalf: They elude court duty in that way.
Adventurers may seek work as a rich man's proxy or may find themselves magically summoned to serve as a champion.