It does sound like a poor connection so any of the parts, charger, cable and USP port of the phone could be suspects.
It’s done to trying alternative chargers, adapters and cleaning the USN port.
I’ll provide some links as it’s not the most conducive of jobs when all you want to do is relax and use the phone.
Links to follow
Here’s one on slow charging, as in overnight especially Although linking to one post you’d be better informed reading the whole topic -ish
Cleaning the USB Port
2 Likes