(1) If any Appellate Court, or the Court of Session in the exercise of revision or of its powers under Chapter XVII, is of opinion that any person convicted of an offence was misled in his defence by the absence of a charge by any error in the charge, it shall direct a new trial to be held upon a charge framed in whatever manner it thinks fit. ...