if it is shutting off, it is possible you power adapter is too small. if using USB power adapter, especially for a larger MacBook Pro, the charging cord may be a standard 60Watts type, and what you need is a premium 100W type.
it is also possible your battery and charging circuitry is in a world of hurt and malfunctioning badly.
The reason you have been advised that you can NOT bypass the battery is that the battery in portable computers serves a VERY important additional purpose. it is like a rubber bag for Over and Under Voltages, smoothing them all out. The battery serves to protect the sensitive electronics from the ravages of unfiltered power. A comparable desktop system is required to have Power Capacitors that do that filtering, because it does not have a battery.
Using your portable computer without the battery connected (for more than quick bench test during repair) risks having a power surge damage it.