I believe that Changing laws after the fact is protected by the constitution. Even at the state and local level.
laws are changed locally all the time...look at the new “no bail” laws in NYS..