Error baking rigid bodies before rendering
Another way you could do it is:

def render_scene(self, file_name):
    bpy.data.scenes[0].render.filepath = os.path.join(self.output_path, file_name)
    bpy.ops.ptcache.bake_all()
    bpy.ops.render.render(animation=True)