Curious. I can't really see why if it works from the MDI, it doesn't when called from gcode.
Just took a look at the CSLabs site M31 macro: This comment makes me wonder:
Probing with M31 macro is done mainly by CSMIO/IP motion controller as an internal function. M31 macro can be freely extended and modified as you wish, what gives an user great opportunities.
Well
G31 is always in the controller so I don't get why they've made the first point.
As far as the second point goes, I'm struggling to see what "great opportunities" their macro offers over putting G31 in your own macro.
All sounds a bit kludgy to me.
What happens if you just put a single simple G31 line in a macro? If that doesn't work I think I'd be asking CSLabs why not.