i got same problem in my laptop .
it was also doesn't work with out battery>
but now its work perfect .
the solution is for my case maybe doesn't work for you guys im not sure
1-remove the battery and charger
2- press and hold the power button for around 30 sec
3- I tried to use different charger and plug it without battery
and its work perfect now without in sudden shutdown
so i guess we can summaries the solution by check the following :
1- the battery
2- the charger
3- driver (reinstall)
4-fan and cooling ( clean or change it)
5- check for any app or program that you install before the problem occur>...
good luck guys and i hope that will be helpful for allof you
regards