The fix is easy. Dont drive underwater.
Not trying to be a smartass but really... if you cant figure it out on your own then the only thing that is going to happen is you are going to sink it, not know why or how to fix it, and then be upset because you just threw $7000 in the trash. You've proven here that you dont have the knowledge or experience to know what's really going on or what's wrong with it. You're the reason people like me buy your bike for $1000 after you've trashed it, given up on it, and want to get whatever you can for it to rid yourself of the constant reminder of your $7000 mistake. Dont worry, you're not the first, and you wont be the last.
Theres a hundred reasons why it could be cutting out. Electrical connections, relay box, fuse box, tilt/rollover sensor, etc. No it's not the exhaust. The stock exhaust will idle perfectly fine completely submerged for extended amounts of time. But asking what you've asked "why does it die underwater" is showing your inexperience as it's the same as going to a doctor and saying "I don't feel good, what's wrong with me?" And expecting a fix.