Headlights go off when car heats up. Replaced headlamp switch and found the insulator on the wiring harness to be seriously melted. 2 days later I had the same problem. Something is causing the connector to melt. What should I be looking at to diagnose this problem. Judging by the web, it was a common problem on lots of Chrysler products.
This is common on all car brands. The problem is you only did half of the repair. The original switch had arced contacts that overheated. The heat migrated out to the terminals in the connector and overheated two of them. That's what caused the connector body to melt. You need to cut out the melted part of the body, cut out the two overheated terminals, and cut off all of the hardened parts of those two wires. That hardened part usually extends about 4". Solder will not stick to that part; that's why you must cut it away.
Splice in 4" of new wire the same diameter. Absolutely do not use electrical tape. It will unravel into a gooey mess on a hot day. Also, do not twist the wires like you do with house wiring. Slide the strands together, be sure there's no sharp points sticking up, solder the joint, then seal it with heat-shrink tubing. Install the appropriate crimp-style terminal on the other end of the wire, but solder it too, then plug those two terminals in individually after the connector is plugged in.
Those two old terminals will be blackened and will have lost their tension. They will cause a high resistance connection which will cause overheating again and will eventually cause the new switch to fail. This repair procedure applies to ignition switches too. All manufacturers are squeezing their parts suppliers to make switches and other parts cheaper, and you're seeing the result. Ford owners are very aware of this. Fords cause more garage fires than any other brand, often many hours after they were parked and turned off.