I had a similar problem with the headlights locking in the down position for a while then after several days would correct itself. Did 4 or 5 times. Turned out it was the SmarTop I had installed. I took it off and no more problems. However the side to side movement still does freeze up occasionally even after took SmarTop off so unsure of correlation there.
'11 Z4 35is
'09 Audi Q5