What does this error mean and is it a Blender bug?
Not all Python operations are supported when running Blender in the background. The reasons for this is that operations are actions from user interface perspective. And some operations uses Graphical stuff like Window, Area or Region classes that do not exist when not having an UI.

The tag_redraw points me into that direction. You might try to fix the operation to make the wm.py not updating the UI at that point, but it not a bug.