Its a very old GRBL bug that is rather tricky to get resolved. I've encountered it around 5 times in approx. 200-300 laser jobs with a total of approx. 200 hours of lasering (gut feeling, need to analyze my log files accordingly).
I'm sorry to hear that this error happend to you in such a critical situation.
With version 0.1.53 of the MrBeamPlugin we released a very promising fix for the error "Invalid GCODE ID: 24". I say "very promising" because it is almost impossible to get a full prove.
Since this version we have a good handling of the event that lead to this error message. If it happens during your laser job, your job will continue without interruption and a notification in your browser appears asking you to send us a short data snippet per email. Please send us this data snippet per email or as a ticket; it helps us to continue keeping track of this issue.
In case you still experience canceled laser jobs because of this or any other error, please submit us a ticket and include your design file and the Mr Beam II logfile ("octoprint.log") with your ticket. We take these issues very serious.