I'd take out the LEFT side and use jumper wires to test/rule-out a faulty RIGHT headlight first.
EDIT: as is use the 12v/ground from the RIGHT side fender connector and connect it to your (good) LEFT headlight to see if you are getting the same problem. Pinouts here:
FYI: headlight connector pinout
If the same problem occurs on the LEFT headlight unit then we know your car is acting up.
Also. Metal expands when hot (wires/PINS' temp is different when current flows). You'd think it would make a loose connection become good when hot but it can also work the opposite side as well. Try to secure all of your female PINS by prying them out gently (especially on the connector in the fender)