Under normal circumstances, it violates a number of fundamental principles of modern legal procedure to punish someone whose crime and penalty were defined only after the fact.
Under typical conditions, it contravenes several key tenets of contemporary legal practice to penalize someone whose offense and corresponding punishment were established only after the fact.