
The side stand sw and the whole interlock chain should be good. I even bypassed all of that by grounding the blue yellow wire to the CDI directly
If I had to guess, that's probably your issue.
I see this time and time again with the side stand switch. My brother had a similar problem on his 2001 DTR many years ago now. My advice would be, if you're struggling to figure out a problem, get it as close to factory as possible, otherwise you're going to be chasing ghosts.
No a mechanically unhealthy engine wouldn't necessarily affect spark, but given how you described riding the bike and it cutting out, indicates that you had spark.
Okay, well it's good to know it's unlike to be water corrosion
But still check those connections anyway to make sure they haven't vibrated themselves to pieces.
Ensuring good connection between that block is essential.
As I said previously, triple check the neutral switch, clutch switch as well. If they are vibrating loose they will cause intermittent problems.