I've had this problem before and it was a bad ground. There's a little white/clear connector just behind the headlight that is rectangular with a metal tab that comes out of this. This metal tab has a hole in it where it is supposed to be bolted to the body. You didn't remove this by chance did you? If so, you have removed a ground from the headlight wiring.
Just a thought.