you have an 06 so i'm assuming you used a rebased hid kit for your h7 halogen projectors.
the intermittent failure is probably because you
a: didn't use a relay harness and the wires aren't giving the ballast enough juice to ignite the capsule(get this fixed before you start a fire in the engine bay)
b: used a relay harness but didn't properly ground the ballasts or have a faulty kit (also likely but not quite as dangerous)
if you don't have a relay take that **** out of your car before you kill yourself or others, i'm serious. wiring a ballast improperly is very dangerous. not to mention illegal.
if you do have a relay kit then it's just because you're using cheap components and they fail sometimes. since it's coming back on i'd bet it's the ballast, not the capsule.