@vertinhol ... it does sound like a battery issue. if it works fine on ac and never cycles, the only viable answer is a battery related issue. This could be a bad battery or the battery isnt really charging due to ic or faulted circuit. The only reason a device would shut down without warning is no power or a short causing instant shutdown. Your device runs on battery for a bit before crashing, so the likely of the two is a faulty battery i.m.o.
You can run a battery diagnostic from a third party app or if you system has a built in service menu that displays battery health.