Intermittent connections are the hardest to solve because they seem to work fine when you are actually ready to test them.
It's often not until you fix and duplicate the problem that you have found it.
I had a relay go bad once, because the relay terminals were not tight they lost there springy contact. This poor connection increases resistance there, where they contacted the relay, and that caused the relay to overheat, and then that made it worse, so the terminals themselves became loose and intermittent. I had to squeeze the terminal tighter with the pliers, then put everything back together with some dielectric grease. This was before I used weatherproof terminals for anything that isn't in the cab.