We've had this problem start around the 4 or 5 year mark. Like many people, we used the opportunity to buy better bulbs. Which lasted as long as 2 months and as short as 1 week. Falling back to oem dealership installed bulbs got us 2 months of use. The dealership couldn't find any problems, but were starting to get annoyed that they had to keep replacing bulbs on their dime. We came to the conclusion that the failing was happening in the readying cycle or after the car is turned off waiting for autoshutdown. Problem, though, no fault could be found out of spec. Solution: We turn the lights on AFTER car is turned on, and turn them off BEFORE the car is turned off. 4 months of no issues, I changed out the bulbs to those evil "high performance" bulbs to see if the problem would come back. It's been a year so far with no failures.
That's been Standard Operating Procedure pretty much since electric headlights were invented. I've had no headlight problems so far.