The judge or prosecutor is trying to get the person to confess to a major crime. (From the context provided, it sounds like he shot and/or killed someone.) If the person does not confess, and the prosecutor does not have sufficient evidence to charge him with murder, the perpetrator could be set free. Instead of allowing that, the prosecutor will charge the perpetrator will lesser, "token" crimes such as illegal possession of firearms (the perp was carrying an unregistered gun). The firearm charge carries a much lighter sentence than murder, but it will at least keep the perp locked up for a short while so that more evidence can be collected.