I had this exact same thing on a Z650 I had a few years ago, the problem there was that K&N pod filters had been fitted but carbs hadn't been rejetted to suit, mains were too small which meant it was running way too lean at high revs, just about died and wheezed on the run home from inverness at 70-80.
CHeck your mainjet sizes against the book, if they're stock you'll need to upjet, typically 10-20% for freer flowing air filters, you may need to fiddle the needle heights to get smoothest performance too.
I put a stock airbox back on mine to solve the problem, if you still have yours refit that and the standard filters and try, if it behaves normally that's where you need to alter to run the K&N's.