My 2004 25 Yamaha runs and idles great on the muffs. I put it in the water still on the trailer in natural. It starts up and runs good for couple minutes,Then shuts off start up and shut off.I put it on the muffs again it runs great.cleaned carb.filter fuel pump working fine ,checked tank and line.seems to have something to do with back pressure on exhaust ???
Recently had a similar issue. Took carb off to clean. When I put it back together it was still doing it. Had a slight air leak between the carb and intake. Make sure your carb assembly is tight and the bolts are snugged good. The air leak was causing the same symptoms of the dirty carb.
What year? I had a 2001 that would shut down on me after I ran it for a few minutes…let it sit and it would start right back up. Ended up being the power pack getting hot and failing. That’s why it would fire right back up after it had a chance to sit and cool off. Could also be a coil, but from the sound of it something may be getting warm and failing.