The romex going into the bottom of the genny panel on the left was backfeeding the whole main panel. The two pole 50 on the left of the main panel thats right under the 2 pole 100 was the backfed breaker.
So let me get the sequence of operations clear in my mind. Power fails Transfer switch transfers the supply that goes from the one hundred ampere breaker in the larger panel to the left hand emergency panel over to the generator. Some bozo comes along and opens both the large panels main breaker and the one hundred ampere breaker that supplies the transfer switch and then closes a back fed fifty ampere breaker in the main panel thus energizing loads in the main panel through the ? gage wire in the Romex. That's very clever in that NOT sort of way. -- Tom Horne
"This alternating current stuff is just a fad. It is much too dangerous for general use" Thomas Alva Edison