MacBook Pro mid-2012 turning on only without battery connected
It’s almost certain the battery is the failure here, but if you had access to a replacement part or didn’t mind spending money on a new MagSafe connector, you could try replacing that first.

The battery is almost certainly the cause dragging the voltage and/or current too low for the system to start. The chance the sensors that check the voltage and current are correct and it’s actually a low current and/or low voltage situation and swapping the battery with a good one would remedy that fault.