Sounds like a bad/intermittent splice. Could be behind or near the switched. Sometimes there's a bunch of slack wire shoved in behind switches and lights. Pull out any slack wire and see if there is a wire nut in there. Try and find the un-switched hot wire behind the switches and the ground and see if it is always on.
Could be a bad splice downstream somewhere in which case it may or may not be straightforward to find. You could try doing a test by finding 12 volts from another source nearby and connect it to the switches and see if the lights stay on. If you can find another 12 volt source nearby that you can run wires from concealed, you might want to just abandon the existing 12 volt supply to the switches/lights and connect to a new source (cap off old wires).
A photo might help and also a model number so photos can be looked up. If the switches are on the end of a cabinet, there could be a hollow cavity underneath that already has wires in it and they are likely easy to access.