new issue with auto tool height, any insight is highly appreciated

I’m using C35 http://cnc4pc.com/Tech_Docs/C35R1_2_user_manual.pdf to control my machine and everything works great, trying to setup auto tool height but there is a problem with the wiring. I tried wiring port 15 and ground pin as the two points for my tool height accessory and there is nothing wrong with it until I hook the thing to the tool/spindle. the issue is that my spindle is grounded to the backpanel of all electronics and that in turn goes back to the earth wire in the electrical socket. never had an issue until the auto tool height wires touch each other while also hooked to the endmill/spindle, when they touch suddenly the unit gives an error and stops working until I re connect to the PC and restart mach3.

so in short, if the C35 port 15, ground port and my ground point all connect Mach3 will pop an error that the motion controller is disconnected.
I also saw very tiny sparks when I made the plate touch the spindle and the wire with hook.

have I made a grave error by putting my VFD in the electronics enclosure which in turn made the spindle ground connect to it and in turn made my whole machine the ground point?