Sounds like a Bill of Attainder.
https://www.law.cornell.edu/constitution-conan/article-1/section-9/clause-3/bills-of-attainder
Yup. A legislative body trying to pass a bill declaring a man guilty and assessing a criminal judgement against the man just because the government hates him.
Not gonna fly.