Don't forget to check your electrical connections for corrosion, and the fuse connectors especially should be cleaned.
An old mechanic taught me to remove and replace all the fuses in my bikes about every three years. it is possible to have a fuse that appears good, shows good continuity on your meter or test light, then it goes open when heated up under a load.
I was driven crazy a couple times trying to track down a problem identical to yours that turned out to be a bad fuse that appeared good and tested good until I was about 25 miles away. The bike would shut down, then restart after it cooled down for about 15 minutes, then fail again. It was a real learning experience for me, and I learned to listen to experienced old mechanics a little better.
I remove and replace all my fuses after three years on a commonly used bike, and upgrade to bayonet style fuses and get rid of all the old open or glass style antique fuses now, and never regret this cheap simple upgrade. Being stranded can lead to new and exciting adventures, but it can play hell with your schedule or appointments, and can reduce your motofun.