@rholt I understand your use case. Once the machine has been homed the axis limits will be respected. But sometimes, especially during testing or commissioning, we just want to test a motor or move a gantry without the machine having first been homed so we use M564 to allow such moves But of course there is nothing to stop us crashing the gantry into the frame.

So pic a spare end stop and wire you switch to it. Or you can use multiple switches (one for each axis) connected in series to single end stop. Then use M581. e.g. If you decided to use end stop 5 the you'd use M581 E5 S1 T0 C0 which would instigate an emergency stop whenever any switches connected to E5 trigger.

https://duet3d.dozuki.com/Wiki/Gcode#Section_M581_Configure_external_trigger