Check the trough opto board for bad or flaky optos, cold or cracked solder joints (optos and connectors). You'll have to pull the boards out to check some of these issues. In switch edge test, phone set to camera to look at the transmitters (pink) to see if they are working and shine the phone's flashlight LED at receivers (blue) to test if they are working.
Also, the opto control board under the playfield can have issues of bad connectors, so reseat the connectors and look at any wires loose in the IDC housings.