Well it's not that the antecedent isn't clear, but it's referring to an abstract situation that doesn't have a gender.
The concepts that "this" and "it" (when it's not a dummy pronoun) sometimes refer to can be a potentially very deep field within psycholinguistics -- or so I see it. I haven't seen much research on it though. The fact that native speakers all the time routinely (unconsciously, and arguably not absent-mindedly) use "it" for plural nouns when those plural nouns refer to a generalised concept ("
DO NOT BRING BIKES INTO THE BUILDING; IF THIS HAPPENS AGAIN IT WILL BE REMOVED, WHETHER OR NOT IT IS LOCKED") makes me think there is a deeper concept at work here. It is related to the idea behind singular they I think, and why it sounds acceptable to the ear in colloquial or even more formal speech, as well as possibly being involved with a part of working memory meant for language that at the moment (for the lack of a better name) call the "topic at hand buffer".