Not sure which of your two problems you are asking about.
First: you said you plugged in...nothing... (problem 1) but then you ran the generator Got power.. For five minutes, Then the Generator died (Problem 2) but suddenly shore power worked.
Tried the Generator again it ran for five minutes and then died. (problem 2 confirmed) no comment on problem 1
problem one, No shore power in the beginning: Transfer switch hung. Now this may be indicative of impending "Doom" (Switch failure) or it might be a bug in the system.. NO, not a "Computer bug" (well do you know why we call computer glitches "Bugs".. i do) but the original Computer Bug (an insect on the relay contacts) used to have to clean bugs off switch contacts on my dad's farm a couple times a year. (not kidding).
You will have to decide if you want to replace the transfer switch "just in case" or if it can be inspected.
problem 2 Generator only runs 5 minutes.. Sounds like the Fuel Filter, but there are other possible issues including (But not limited to) air filter, dirty carb and low oil.