As FFZ said, the ignition system killing the fuel seems likely, but you said it would run at a high RPM right? That makes me think otherwise.
I've seen water in the filters cause a similar condition, where the motor could maintain a high RPM but would die at idle.
Good luck Nick, don't let...