I've had this problem on my switch. What I'd do first is check that the console fan is still working. If it is, a faulty ic could be the cause.
BUT considering you also have an overheat problem, it's much more likely you have a fan issue. And for some reason, a non working fan causes problems with the joycon charging circuit.
What I did was replace the fan of my console (obviously changed thermal paste while at it) and voila! It was working again as intended.