Xantrex (Trace) SW2512's are pretty particular about how you wire ATS's and generators to them. For example, they do not like switching between shore power and generator without a 100ms delay between disconnecting one source and connecting another.
There is a separate input for generator on the inverter that you are supposed to connect the generator to.
After reading about the TRC 40250 ATS
here (p8) it looks like it may provide the required delays.
Xantrex seems to have done away with their SW2512 manual but
Kyocera still has it. Note this is the non-MC (motorcoach) version, the MC version has different firmware but identical hardware.
The SW2512 does not operate like most other inverters, it actually has the ability to backfeed the line (think grid tie solar applications) so the power topology is totally different from your run-of-the-mill inverter/charger. The firmware in the MC version disables this feature.
There should already be a relay to open the neutral-ground bond of the inverter, i.e. the inverter neutral should only be shorted to ground when there is no shore or generator power. Maybe that relay has gone bad?
Good Luck!
Stewart