A fault like that isn't going to show up in a static test, needs to be tested under dynamic conditions
Erratic faults can be tricky.
I once had a Suzuki RM with a stator wire that was broken inside the resin.
It would start & run just fine...'til it got really hot. Then it would run erratically for a bit & then stop dead.
Would not spark again until it cooled down. Heat was expanding the stator and separating the connection.
I dug the hair width wire out and after a couple of attempts was able to solder it back to the main wire.
Covered the repair with araldite, worked fine for years.
Cheers Daryl.