You either have improperly grounded system at the machine or your supply panel system ground is defective, i.e. one side of the supply is not grounded.
It should not matter how your connections are made, a properly grounded system you should not have any potential to ground from any metallic part of the machine.
This is normally qualified by an electrician using a resistance Megger, (not a high voltage insulation type), the resistance type is used to measure earth ground path resistance.
Al.
CNC, Mechatronics Integration and Custom Machine Design
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.