It seems that the plug got already "repaired" by some "handyman" with a sluggish soldering job.
I doubt that the receptacle of the bulb is available separately. Perhaps you want to go to the local scrap dealer to look for a used headlight
Supposedly the was a dealership recall for the 407, the problem where the melting "H1" bulb connectors.
I, personally, would
- Look if the recall is valid/still active for you car.
- Replace the headlight with an after-market model or one from the scrap-yard. (After-market headlights start at about 100€ at my location, let a garage adjust the headlight inclination afterwards)