Thanks for the input DropTop... the lights work fine most of the time, so I don't think it's the ballast or bulbs. I think I found an answer on an external site as follows:
"If the inoperative headlight varies from left to right, when you have the fault warning, we would suggest that the lighting control module may be at fault. The module is a part of the light switch, on the Z4 chassis. Therefore you must replace the complete assembly if either the switch or the module are faulty. The fault could also be in the individual light control units (I would not initially suspect the ignition elements, as the lights seem to fire-up just fine). However, it would not be as likely that both units are faulty and intermittent in the same way."
"If the inoperative headlight varies from left to right, when you have the fault warning, we would suggest that the lighting control module may be at fault. The module is a part of the light switch, on the Z4 chassis. Therefore you must replace the complete assembly if either the switch or the module are faulty. The fault could also be in the individual light control units (I would not initially suspect the ignition elements, as the lights seem to fire-up just fine). However, it would not be as likely that both units are faulty and intermittent in the same way."