BIG trouble for the skipper. He will have to stand tall before the man and explain how he ran the peoples ship onto a sand bar when it has ALL the equipment to prevent it from doing that.
After he explains all this and gets knocked down several ranks, he will then be mustered out of the navy or put somewhere they will never hear from him again.
Lots of finger pointing will be done, but, he is the skipper and he is the one responsible.
Unless he did something particularly stupid, he'll be allowed to retire if he wants. Most SS(B)N Captains have well over 20 years before they ever get command.