Phone gets stuck after charging
Your device is very old and contains dozens of vulnerabilities. Therefore one very likely scenario is that malware has infected your system using one of the vulnerabilities and now uses your CPU to do something, e.g. Bitcoin mining or something similar.

As on Smartphones heavy CPU usage results in high battery usage (which is usually easy detectable by the user) this malware only abuses your device while it is charging.

As it is so old I assume it has only one CPU core and if the malware is active the CPU operates at full capacity and hence the device is nearly blocked.
The detection if the device is charging or not is a bit slow therefore this effect continues some time after you have disconnected the phone from the charger.