bpy.ops.sculpt.brush_stroke Incorrect context when called using the bpy module in headless mode
bpy.context holds some information about the current windows and open views which is needed by bpy.ops.sculpt.brush_stroke and not available in headless mode. Take a look at this example here to see how to use brush_stroke() without headless mode. If you use Blender on a machine which doesn't have a graphical user interface, you could use a virtual frame buffer (see here).