This sounds very much like one I read several years ago. The title was Secrets of Stardeep, an early work (published in 1969) by John Jakes -- who later became more famous for such things as his bestselling multi-generational saga of American history called "The Kent Family Chronicles," and to some extent for his sword-and-sorcery tales of "Brak the Barbarian" (basically a blond pastiche of Conan the Barbarian).
Anyway, getting back to Secrets of Stardeep, the main viewpoint character was Rob Edison. His father had been Duncan Edison, the captain (called "Lightcommander" in their culture) of a starship which had vanished mid-voyage with hundreds of people aboard. As the novel begins, some years later, the ship has never yet been found, but a board of inquiry called it a case of "command error." (Which is to say, presumed to be the fault of Rob's father . . . in some unknown way.) Rob strongly resents this slur on his father's good name, and is bound and determined to someday uncover the truth of the matter . . . whatever it may be!
Just as you remembered, toward the end of the book, while exploring some caverns on another planet, Rob and some acquaintances discover that the remains of the lost starship are embedded underground where the vessel had suddenly emerged in the wrong place (from "hyperspace" or whatever the heck the ship traveled through -- I don't remember all the jargon) as the result of severe navigational error. It turns out that the late Lightcommander had made the mistake of trusting a painfully underqualified young officer to try to practice steering the ship in order to improve his skills . . . with the result that nearly everyone aboard died quickly (embedded in solid rock, for instance) because the young man just wasn't up to the task. Which means, as Rob quickly realizes, that it truly was a case of "command error." His father was supposed to know better than to trust the wrong person with control of the ship.
Here's a link that shows you the cover of the paperback reprint volume that I picked up cheap, somewhere. It reprints the story I just described, and another early SF novel by John Jakes. Since that was printed more recently than any editions of Secrets of Stardeep as its own little volume, this version ought to be easier to find if you want to track it down and buy a copy so you can refresh your memory. (Frankly, I didn't think it was anything great when I read it -- I'd mainly been curious because I had not previously read any standard-issue "science fiction" stories from John Jakes.)