OK managed to have a quick check in the workshop.

Fired up PC and still same problem.

Unplugged the microswitch and used a multimeter across the terminals whilst pressing the lever. The multimeter beeped but as the switch clicked across the beep was a bit warbly just before it stopped as if the switch contacts were not that clean.

I fitted another microswitch and squashed the terminal connectors a bit on the cables to make sure the joints were tight. Tried homing again but the same problem.

Tried debounce 5000 (x40us) and it homed properly although there was the expected delay. Then tried 1000, 500, 100, 50, and finally 2 (x40us) and they all homed properly with reducing delay. I kept the 2 (x40us) value and homed 10 times in a row and each time was perfect. I'll leave it like that for now.

I think the machine knows it is building it's successor and is chucking a few things at me along the way!