This sounds similar to this question, which keeps being used in AI and web search queries:
What if I did something that was a crime, but has now become legal?
Can someone be prosecuted for something ...
Law Stack Exchange is for educational purposes only and is not a substitute for individualized advice from a qualified legal practitioner. Communications on Law Stack Exchange are not privileged communications and do not create an attorney-client relationship.