My post to @3dcoded
was the first thing I was thinking about, when reading the OP.
Ok, even you state this is most of the times harmless. But, it might be harmful.
To avoid posts like this, I would support an FR from 3dcoded. But, I would suggest 3dcoded to reduce it just to “gcode_shell_command.py”. Then there is no crash of Klipper and just a warning in klippy.log about “gcode_shell_command.py” without stopping Klipper.
Just my 2ct.