As others have pointed out this analogy is kind of bad. But… also you seem to clearly acknowledge within the hypothetical that performing an action would be a crime, and then do the action. And then you’re upset because it wouldn’t have been a crime if it hadn’t been made a crime… but it was and you knew that and you did it anyway.
Yeah, these analogies are always terrible, but this one actually includes the "hey they ruled it was a crime and I decided that was bullshit and kept criming" part.