... a time when the expectation was that the "hero" would always have all the answers regardless of the circumstances.
I do hate disillusioning you, but the idea that the hero won't always succeed is one of the core elements of the grown-up western. If you have a couple half-hours get some of the radio Gunsmoke
episodes --- they're easily available from archive.org and the like --- as while they're generally good shows, it's shocking to realize how rarely
Matt Dillon is able to reach a happy conclusion. The best that's usually achieved is that at least the damage can be mostly repaired.
This isn't a knock against the Original Series. Part of what gives it its flavor is that it is
a grown-up western set in space, where the protagonist is trying to provide order in a chaotic world and where one can realistically expect to just not be up to it at times. (Later Trek is much more an office drama set in space; while there is always the chance of failure, there's much more structure and organization in place around the characters, and a failure is less of a reflection of their smallness against the cosmos and more one of the system not having properly addressed the case just yet.)