I spent the last one and a half race seasons chasing a similar issue with my Honda RS250 road racer. It turned out to be a weak coil- the CDI and powervalve computer were operating just fine but I was getting inconsistent spark when a load was applied to the engine. On the work stand it seemed fine- but on the track it would cut out and run all boggy. Plug chops revealed good jetting, ohm tests of all components showed nothing. EVERYTHING looked as it should, and tested fine ON THE BENCH. A fellow racer finally noted a tiny flaw on one of the input wires to one of the coils, which eventually (once the HRC unobtanium was found) lead to a replacement of the coils and wiring connections.
A replacement coil would possible be easier and cheaper to obtain than a new CDI for your 400 and might cure your problem- it certainly sounds like it's not a fuel or exhaust issue to me. If nothing else it'll be a cheap item to rule out- the ebay link below is a whopping $12.00
A few quick links, via uncle Google: