Power off the machine (Not the PC), manually turn (crank) the stepper motor so that no switch is active.
Turn machine on
Click on [reset] in MACH3 and try ref all home again.
If it works this time, you must do two things
1. Set your "debounce" to 50 or more - in top right hand corner of settings | general settings page (see attached)
2. implement"soft limits" which is from 0 to say just 0.1 inch before the limit switch at the other end of each axis. Then always leave soft limits on.