That error is happening because the script fails to open the log file. I probably should trap that error, give a better error message and allow the script to continue.
But that does not explain why enabling Canon RAW only causes the log file open to fail. Some sort of timing where the Canon RAW save blocks the log file open maybe? I seem to recall seeing this before. A retry mechanism in the log file open was the solution IIRC. I'll add that tonight and post a script update.