Possibilities you should check:
• May be it's because software problem on your phone. Have you rooted your phone? If yes, then sometimes it happens when we root our phone. Better to do factory reset your phone.
• Second possiblity is their may be an app who run on background; better to uninstall all unnecessary application's which you don't use much more.
• Third possiblity, it may be because the battery of phone is not real/fake.
• Charging port may be broken from inside hence your phone misbehaving and not showing that your phone is charging/not or gives you false result.
Sent from my Moto G (5S) Plus using
XDA-Developers Legacy app