Hi Ben,
I am glad that you found the answer: my own guess was that it was electrical due to me experiencing a not entirely dissimilar problem years ago with an M16 Plus4 which turned out to be the alternator which and the end of the long list I decided to replace. The engine was sometimes hard to start but would then run well until 4000 rpm when it would cut out and idle for a few minutes. If anyone else comes across this problem, the altenator would be one of the places to look.