Connect everything back, place lights at various places as well as knowing where to measure voltages.
When power stops look at the lights and measure voltages to see where the issue us located.
Suspect loose wire inside connection for transformer, these tend to work loose over time, combined with higher loads the changing temperature of the wire due to resistive connection causes the connection to become so loose the wire almost Falls out of the connection.
Do not just fix it, put everything back to normal, then confirm with measurements where the connection is failing, repair and retest.
Then inspect everything else
Tony & Lori
1989 Country Coach Savannah SE