Assuming you don't have a loose connection the most likely cause of this is a totally integrated power module (TIPM). The TIPM controls the lighting circuits so again, assuming the wiring is not the issue this would be it. The only way to confirm the wiring is not the issue is to get this to act up by wiggling the wiring harnesses going to the lights or when it acts up, you are able to move the wiring and it stops.
Based on the fact that this is not consistent, if it were me, I would replace the TIPM and if it doesn't act up again, then that was it.
Images (Click to enlarge)
Saturday, September 19th, 2020 AT 6:39 PM