Please do make sure that the battery is well seated in the laptop. Remove the battery first for couple of seconds the unplug the AC adapter as well then press and hold the power button for 20 seconds then put everything back together and see if it will work with just the battery connected. If it will not work remove the battery again then power the laptop with just the AC adapter connected and once it's booted in the desktop screen put the battery back in and see if it will charge or not. If all these will not work I would take it back to the store where you purchased it from and replace it with a new one so it won't cause anymore problem in the future.
My brand new lenovo laptop suddenly shuts down if i remove the charging cable and it will not turn back on unless the cable is plugged in but when on charge laptop works completely fine
You can call Lenovo support. It should be under the warranty. In my case, I found out that the female power seat was not sat properly when I opened the laptop to check for the battery. I put it back and now it is working fine. I think the laptop might be dropped at one point in time.