Hey this is most commonly a battery issue.
If you left it discharged or did not use it for a while, it is possible that the battery dropped below a threshold voltage. What happens than is the BMS(Battery management system) can prevent the battery from charging as it has dropped below what's considered a safe level.
This essentially cuts off the battery from your device, resulting in the symptoms above. Your device will work when plugged in and will commonly show full battery when trying to charge as there will be no battery to charge.