An intermittent issue that results fm a loose or poor connection can be frustrating to find. The good news is that since they are both effected at the same time it is a common connection between the two. If you are comfortable tracing wires (following them along) see if you can first determine if the power (+12VDC) or ground is the common link. With that common link determined, the issue necessarily needs to be between power (or ground) and where that common link ‘splits’ to go to each unit. Think of a “Y” > the base of it is the common power or ground and it splits to go to each unit. If the Y’s base becomes disconnected from power (or ground) then both units go dark. Thus, it’s the base that is the focus. Note the base can be a ground bus as Scott highlights. This a strip of insulated metal with lots of screws on it and wires coming off of it but has one ‘main wire’ (the base of the Y) that goes to the Neg side (ground) of the battery (or if a +12V bus, the positive side of battery). With the CB on, start wiggling the common link. If it goes off and on you have in your hands the issue. From there is it a loose connection or just what? You will need to play around a bit to figure that out.
If you have circuit breakers it’s also possible that if a single beaker is tied to both units, the Ckt Bkr could be faulty.
If you are comfortable with using a Multimeter getting some insulation piercing probes like this (
link) can also help troubleshoot the issue.
Good luck and keep posting your questions and results.