400ex shutting off for unknown reason

Hey guys. I have an 05 400ex and I race cross country and the last two rounds my quad has just randomly shut off halfway through the first lap. I have checked my carb and cleaned it. Cleaned the gas tank and checked my wiring on my kill switch and my spark to my plug is good. Battery is good and checked the regulator and stuff like the manual says with a multimeternal and it all checked out good. It runs fine the first half of the lap and just dies and won’t fire back up. I get towed back to my truck after sitting for about 40 minutes and it fires right up and rides fine until the next race. I need help!! Anything anyone can suggest would be awesome! Thanks!