Thanks for the reply and welcome. It does "back off", just not far enough to reset the switch. It does the same on all 3 axis so not a switch problem. If I manually press the switch and release as it is backing off it completes and starts to home the next axis but does exactly the same thing on that axis.
The button script is -
DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )

DoOEMButton(133)
DoOEMButton(134)
DoOEMButton(135)

I can't find a way to edit these commands.

I set the "debounce interval" in general config to 1000.
John