Unknown Command: "M140 S0"

The problem is almost certainly in your software pipeline, not your firmware, and this error has zero impact on your ability to use your machine. It is likely that whatever you are using to send the g-code to the machine is inserting this g-code. Look for any “end” script (scripts that get inserted after the main g-code file is executed) in the g-code sender and edit it to remove the M140.