It is not a grammatical error: such an error would mean that the sentence is not constructed according to the grammatical rules (of English), when clearly it is. What you probably meant is that it's a semantic error: the writer used a construction which doesn't not convey the intended meaning.
As an example, substitute the impossible fact of both wearing a mask and not wearing a mask by "both walking and not looking frontward" and you would obtain a sentence following the same construction, yet doesn't seem to carry an incorrect meaning.
The effect of such a combination of laws would be to make it unlawful to go outside. The effect of a law as stated in the tweet would be to make enforcement impossible, as nobody would be both wearing and not wearing a mask: each perp would be doing one or the other.