Headlight door motor issues are a common problem, have been since the early days of hidden headlights. In your case it sounds like a bad connection to the re-tractor module (behind the left side of the dash) or it is starting to fail.
If it was only one light I would say it is a motor but with both it has to be in the control circuit. It is not a hard system to test but the module test is basically, if it works it is good if not replace it. The "works but then does not" intermittent items are the worst to trace. Basically you pull every connector and clear it and test until you find the bad one.
Image (Click to make bigger)
SPONSORED LINKS
Wednesday, May 31st, 2017 AT 3:52 PM