Short description of error
When changing the bake settings i.e, enable/remove diffuse. The log in the info panel is different from the actual command. As mentioned here this seems like a minor bug.
Exact steps for others to reproduce the error
Just enable / disable the diffuse/glossy options in the bake settings.
The log shows this bpy.context.scene.use_pass_diffuse = False as the command.
But, the actual one is this bpy.context.scene.render.bake.use_pass_diffuse = False
Let me know if any more info is needed.