You really have it quite messed up Grounding is simple just has to be done correctly
You are using ( 2 ) power source's a 120v supply and a 240v supply for ( 1 ) machine you have ( 2 ) separate Grounds ( 1 ) Ground for the 120v supply and ( 1 ) Ground for the 240v supply this is where your Ground loop comes from, a Ground loop is formed when you use ( 2 ) different supplies for the same machine
You should only have ( 1 ) power supply source for your machine
How do you fix this you use a 240v 4 wire supply this is the correct way to do it and the only way to avoid a Ground loop
So the 240v supply will have 2 Hot a Neutral and Ground, which will give you 240v / 120v supply for your machine you split it up from there to where it needs to go
You VFD Drive also needs to be mounted in a metal Box also or at the least on an aluminum / steel plate so this can be the Ground Plane
And a EMI Power Filter at the VFD Drive supply input will be needed, this is the Power Filter you need
TDK Lambda RSEN-2030L There are no substitutes these are the best EMI Power Filter for your install
None of these things will change until the VFD Drive is mounted correctly and the Power supply is corrected
So first figure out your 240v main power supply 4 wire should be a minimum of 25A supply 30A is better for your machine, and I will help you get the rest of your wiring done how it should be
Will need photos as you progress