I know what happened with your generator and it's utterly insane what they did. It looks at one point this building (is this really a house?) was set up to manually transfer over to a generator with the ability to isolate from mains. For whatever reason, they had a new generator installed with a fancy ATS, but wanted to keep the old school switchover, so they did some outrageous hacking.
The way this is supposed to work, is your ATS is supposed to be a "sub panel" from your main panel. According to Generac, the ATS's "mains power" input, is supposed to connected to a 70A breaker in the main panel. Then, the ATS is pre-wired with individual branch circuit wires (those are the colorful wires you see going over). You're supposed to take the circuits you want energized in an emergency, disconnect them from your main panel breakers, and hook them up to those wires coming from the ATS breakers. When you lose power, the ATS's "mains input" goes dark, switch transfers over to generator, and the generator starts up. Your "sub panel" is then powered from the generator instead of the mains panel.
But the previous owner of your house did not do that. None of it was ever hooked up. Instead, they did an absolutely absurd amount of hackery. You can see all the colorful wires just sitting there capped with wire nuts. You can see what is supposed to be the mains feed to the ATS taped up and tucked away. Now, look at the service entrance coming in through the top of your main westinghouse panel, that wire goes to the main breaker/disconnect at the bottom. Where the service entrance goes into the main breaker, they stuck in two tiny wires on each leg, and ran them over to another switch they haphazardly added next to it. Then when you look over at the ATS, they spliced in two wires to the main bus-bars coming off from the ATS, and brought those wires over to the main westinghouse panel and connected them to the other side of the switch.
This means your generator is effectively directly connected to the "service" side of your main panel. So when you flipped the fused mains disconnect off, the generator noticed a loss of power, and turned on and began feeding power into your main panel through that red switch, through those tiny wires, into the input of your main panel's main breaker. At that same time, it was also back-feeding power through all of the other wiring on the "service" side of that breaker. As soon as you closed the the fused disconnect labeled "A", you connected your generator directly to your 200A mains feed.
I've attached some pictures diagramming it. That whole setup with the two disconnects, ATS, crazy knife switch, and three separate breaker panels all need to be ripped out, consolidated, and wired up properly. There is a chance your generator may still be okay, but it likely didn't enjoy that experience.

