Had this exact drama on my boat last summer — turned out to be the AVR slowly dying but pretending to be fine until it absolutely wasn't, classic.
Few things worth checking before you splash out on a new AVR though:
- Fuel flow — dirty carb or partially blocked filter can cause it to load-hunt and cut under demand
- Capacitor on the exciter winding — these fail silently and mimic AVR death convincingly
- Brushes — if you've got a brushed alternator head, worn brushes cause dropout under load exactly like you're describing
The "mid-cycle" detail is interesting — is it cutting at a consistent load point, like when something big kicks in (fridge compressor, inverter charger pulling hard)? On my setup I've got a Victron Multiplus and the inrush when it goes into bulk charge has killed lesser gennies.
What make/model is the generator? Some of the cheaper Kipor-style units have notoriously flakey AVRs that are actually a fiver on eBay — genuinely, the replacement is sometimes better than the OEM part because the OEM was rubbish to begin with.
Also worth sticking a clamp meter on it while it's running to see if voltage is collapsing before it cuts — if voltage drops first, AVR or capacitor; if it just dies with no warning, look at thermal cutouts or the engine side.
Don't bin it yet — these things are almost always fixable if you're willing to poke around a bit. What are you running off it?