I have never seen a cdi get hot and shut down , cool down and work numerous times like that ---- but I am sure it could happen --------- I would think either a tank vent problem or the cylinder heating up , expanding and loosing compression
I wonder if you were to wrap a freeze pack or a bag of frozen vegetables around the cdi and ride it an see if it still shuts down , LOL
Fish when my CDI went, this is exactly what it would do, had me going nuts as couldn;t figure out what was wrong, tried all the basic's , all seemed fine,
would run great then after a few minutes or so running, get HOT< fan kick on, and then run like it had no power, would stall at random, shut off, re start, let cool down, and be fine again , and repeat, or NOT.
I went nuts trying all things, replaced a bunch of things, and then finally gave up, took to dealer and had them a go at it, they had it for 3 months, too , and re did everything I did, and then, they swapped in a new CDI< and BOOM< darn thing worked like new again?
only flaw in things was dealer CHARGED me for a new OEM CDI, a few weeks later things acted up and I checked to make sure CDI was plugged in good as they didn;t put it back together right(rubber holder wasn't holding it in place??)
that's when I found out they used a aftermarket CDI< and it didn;t fit in the rubber housing to hold it in place,
I swapped it out with a NEW OEM one, and its been running like new every since(about 8yrs now)
so, funny things can happen to electronic parts IMO< and I also think aftermarket electronic's are a gamble at best, and will NOT buy them , or at least for honda 4x4 atv's!
the sport atv's seem to have better luck with em!
I have also seen fuel pumps again, loose pressure, or have erratic pressure issue's<
compression test is needed here I think!