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.