I'm experiencing a variation of this again, but I'm not sure if it's a bug or working as designed.
Again, I have an epidemic in my land. I closed the gates, but, after a while, food ran out and everybody got negative hungry modifiers. So I opened the gates and my nutritional health returned.
Some time has passed, but the epidemic is still enveloping the land and now my ruler and his family are getting sick. It says I can shut the gates at the top of the screen, but the option to do so in the Intrigue tab is greyed out.
It could be that there is some cool-off time period that has to pass between opening the gates again and re-closing them. Or maybe one can only close the gates once per epidemic?
If neither of these are the case, then it looks like its the same bug again. Can anyone confirm whether what I'm currently experiencing is working as intended, before I try editing the game with console commands?
EDIT: Maybe this time it's because I have an "Abandoned the commoners" tag, which I got from closing the gates, which expires in a few weeks. So it looks as though this tag functions as a cool-off period between opening and closing the gates.
2ND EDIT: A few weeks have passed, the "Abandoned the commoners" tag is gone and I can close the gates. So all is good and working smoothly!