I'll jump in here. We chased VERY similar problems. Yanmars very commonly have undersized wiring. They work fine for a while, but sooner or later a bit of
corrosion creeps in, and there just isn't enough
current to properly fire off the starter (or shut down the engine). Voltage will check fine. After
Hurricane Harvey, we replaced the wiring and panel for our 4JH. ALL of our problems went away, including the intermittent start problems. We decided to do the same on our
generator, and lo-and-behold, our
remote oil pressure gauge, which hadn't worked since we bought the
boat, started working. If yours hasn't been rewired, it will need to be, so just do it. It's a
cheap fix, most of the time.