In this case, I think the grammar is just wrong: an em dash with spaces around it! Although I'm not so much of a stickler that I'd personally consider this to be a problem.
An em-dash (in this use, there are others where the normal style differs) set with regular spaces around it isn’t a grammar problem; it is a less common style preference (usually they are set closed—without spaces—or surrounded by thin spaces, or an en-dash surrounded by regular spaces is used instead.)