I have an 03 that was doing nearly the same thing when The outside temp was hot or I was in heavy stop and go traffic. I found that there is a circut breaker in front of the battery. That breaker can get hot from the exhaust and the ambient temp and can trip. if left long enough it will reset and the bike will run fine until it gets hot again. It was a recall on 01 to 03 bikes as it was a 40 amp breaker it was replaced with a 50 amp. since I replaced it I have had no problems. Mine did nearly the same thing with the dash going completely dead like the key was shut off, then when it came back to life it would sometimes run like crap, only to wait again and it would run fine. The problem was intermittant and would not always do it in the heat, but it seemed that when it did quit it was in heat.
Hope this helps