I had the state atheism trait and got vassalized after losing a war, which forced me to adopt the liege's religion (Buddhism). Later when I got my freedom, I noticed that my state religion is still Buddhism, and due to me having the atheism trait all the options related to religion were locked. As the trait is also irreversible, I am effectively locked in to being a Buddhist.
I would expect my state religion to return to atheism after regaining my freedom.
Step by step of the bug
Step 1
Enact the state atheism trait
Step 2
Lose a war and get vassalized, adopting the liege's religion
I had the state atheism trait and got vassalized after losing a war, which forced me to adopt the liege's religion (Buddhism). Later when I got my freedom, I noticed that my state religion is still Buddhism, and due to me having the atheism trait all the options related to religion were locked. As the trait is also irreversible, I am effectively locked in to being a Buddhist.
I would expect my state religion to return to atheism after regaining my freedom.