If the jury is discharged because the facts as charged do not constitute an offense punishable by law, the court must order that the defendant, if in custody, be discharged; or if admitted to bail, that his bail be exonerated; or if he has deposited money instead of bail, that the money be refunded to him, unless in its opinion a new indictment can be framed upon which the defendant can be legally convicted, in which case it may direct that the case be submitted to the same or another grand jury.
Idaho Code § 19-2122