No order of dismissal or directed verdict of not guilty on the ground of a variance between the indictment or information and the proof, or on the ground of any defect in such indictment or information, shall bar another prosecution for the same offense. Whenever a defendant shall be acquitted or convicted upon an indictment or information charging a crime consisting of different degrees, he or she cannot be proceeded against or tried for the same crime in another degree, nor for an attempt to commit such crime, or any degree thereof.