Well, the king only named him hero in the end because the kid Eric saved was his grandson, so Eric mainly got the title due to his connections (remember, they initially rejected him despite everything else because his clothes exploded).
That's pretty much the definition of nepotism; it just happens to be a very understandable and acceptable version, allowing the king to publicly walk back a decision, instead of, ya know, the shit we gotta put up with in the real world where unqualified and/or uninterested folks get high paying, high power positions just because of whose sack they came from.