Would a large airliner such as a 747 or an A380 survive an inversion?
Could it? Yes.
Tex Johnson famously performed a roll in a Boeing 707. If performed properly it is a 1G maneuver (the airframe experiences +1G stresses through the maneuver - as far as it's concerned nothing unusual is happening).

Should you attempt such a maneuver without aerobatic training? No.
Should you attempt it in an aircraft not certificated for aerobatic flight? Absolutely Not.
This is one of those "If you do it wrong the wings fall off" maneuvers, and chances are you're not Tex Johnson.