I think that is not a problem made by M2
The error occurs only when executing the procedure with no tool, if before run the procedure I do T2 M6 the procedure don't fail!
So I think there is some variables not initialized at startup and when LinuxCNC try to restore global settings it fails with an error...
Code:
if (status != INTERP_OK) {
char currentError[LINELEN+1];
rtapi_strxcpy(currentError,getSavedError());
CHKS(status, _("M7x: restore_settings failed executing: '%s': %s"), s, currentError);
}
A workaround is do an unnecessary tool change before starting the procedure to set all the variables used.