Many Onan generators are smarter than many humans.. For example.. If the generator is not working (That is putting out power) why keep burning fuel?
Several things will cause a shut down,, Frequeny out of range, Voltage out of range, Low oil All will cause a shut down,, these sensors are BYPASSED when starting.
Bad connections on the control board can cause false out of range readings
Bad control board can think normal is out of range.
And this is only some of the things that can do it...
One thing that may help is reading the error code.
On, one other thing.. You said only the dash switch starts it, the "local" switch, I gather does not.. this argues strongly for bad connections.