That looks like a standard RC filter, prevents Inverter noise getting back into the line.
This type is usually used on the input side rather than the motor side.
But I suspect you have not got the ground wire on the unit connected to a good system ground, if you do not, there is conduction via the capacitors to ground wire, and if this is not grounded, then you will feel the effect of the leakage.
Al.
CNC, Mechatronics Integration and Custom Machine Design
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.