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 standard circumstances, it infringes upon several basic tenets of contemporary legal practice to penalize someone whose offense and corresponding penalty were established post-hoc.