Check all connectors are tight especially the large onethat connects to the ECU.
This year at the DSC Cadwell trackday my 996 would just die after I had used it in a wet session, never did find out what that was as it was fine when I got it home and has since been out on quite a few rideouts and runs to work
The Year before I had a lack of power that was caused by a blocked fuel filter which is what happens when you leave your trackday tank standing for to long
and a few years ago again at Cadwell we thought Dallas's 996 had a ignition pickup problem but that was traced to the main ECU connector working loose
Checkout the Desmo Due Paddock on Facebook