I'm actually experiencing a similar problem, so I just wanted to chime in.
When I plug in my Surface Pro 7 i5 after it has been on battery for hours, it gets SUPER hot and it stays some crazy big number like 2 hours to full charge even from like 30 percent. I can verify there are no especially demanding processes going on, but it just starts getting super hot and charging very slowly.
A few times the charging even froze completely, with it getting so hot, it was using power at the same rate it was losing it so the battery percentage was not increasing at all for almost 30 minutes.
It doesn't ALWAYS do this, but it does this very OFTEN and it's very annoying because sometimes it charges super fast and other times it literally takes hours and hours to achieve a complete charge.
Now, I do find that restarting the device seems to fix things, so I'm almost certain that there is some sort of software glitch that is causing this to occur.
I love this device so much but this overheating charging issue is really annoying.