Where a defendant is acquitted of a criminal charge upon trial on the ground of a variance between the indictment and proof, or upon exception to the form or substance of the indictment or record, he may be tried and convicted upon a subsequent indictment for the offense actually committed, notwithstanding such acquittal; and it shall be the duty of the court to order the accused into the custody of the proper officer.
In all cases of acquittal on the ground of variance between the indictment and proof, the jury, in rendering its verdict, shall so certify.