Similar intermintant failure on Merc Gran Marquis GS.
Drove me nuts.
Finally had Ford dealer diagnois. It was the main light control module under the dash.
Cost me $900 at dlr to repair. Found out on internet this is common problem, and module can be repaired (per their qote) outfit in NJ for $50. send in module and they repair/send replacement module. Dont remember exact locatio, go to fix my car maybe, or ebay ??