I think this is caused by the dc input jack, inside the barrel of the dc jack there is usually a small metal strip that gets pushed to the side by the charger tip. This metal strip is then supposed to make a firm contact with the ground pin of the dc jack.
This is just me speculating. But the metal strip is also connected to the board and will power the board, regardless of whether the metal strip makes a firm contact, perhaps this metal strip is to detect whether the charger is actually connected.
If I am correct then you could fix by replacing the DC jack, or for a total bodge job you could bridge the solder joints of the metal strip and the ground pin of the dc jack. problem here is that it would essentialy be stuck in AC mode.
I think I am correct, as I am using the wrong charger tip on my charger, I diced and spliced this charger tip when my original one broke. It fits well enough to charge and power the laptop but i've notised that if you wiggle the tip it will occasionally toggle between AC and DC mode, however it never powers off with the battery removed. So I am 99% confident this is what is happening.