Was driving to the gas station after work today. turned off the car while fueling and when i turned it on my low beams where off but i didnt notice. No error code no warning. But as soon as my car starts to go the lights turn back on

I tested it by stopping and going and everytime i stop at a red light the low beams would go off. I get out to check out whats happening and my angel eyes are on fine. Still no codes no errors. Looked if the ballast was wet or bulbs and everything was fine. Has anyone encountered this issue? this only happened to me twice now. Once during a REALLY havy rain storm and this time after some rain. O and i fixed this problem by turning the car off and turning it back on after that the lights worked normally.