Star Trek is fictional. No one ever does everything right and good decisions always work out better than bad ones. Life is mostly what you make out of it. When one loses one ought to try something different next time.
Even if the result seem bad to the lay observer, how does the lay observer know that correct decisions
were made that resulted in a conclusion less bad than it could have been? Likely, only someone on the inside knows how bad it
could have been or how accurate the data were while the decisions were being made.
There was a situation during the War of 1812 in which the USS Chesapeake was sent into combat against the British. Among its complement was a "third lieutenant," a teenager out of the new Naval Academy attached to the ship for training. He had no actual job at all, except that he was the very last link of the chain of command.
During a battle, the captain was wounded and the 3LT carried the captain below decks for treatment by the medic. While he was below decks, every other officer on the ship was wounded or killed. The ship was captured by the British and the surviving crew kept as prisoners of war for the duration. After the treaty was signed, they were repatriated. The Navy investigated, prosecuted, and convicted the 3LT for dereliction of duty:
Being away from his post while in command of the vessel. It's a fact...Google "USS Cheasapeake." But could the 3LT have prevailed in the battle as the commanding officer? Probably not/
In WWII, there was a night battle in the Pacific in which a Japanese fleet and an American fleet were literally interspersed and firing at each other at point-blank range in the darkness. Again, there was a junior ensign who wound up the senior remaining officer on the fleet flagship in a desperate situation in which he was the only officer who had communications with the entire fleet. He realized he didn't have enough combat experience to win the fight...so he successfully commanded a disengagement and retreat (which isn't easy....a retreat is one of the most dangerous tactics to attempt). That ensign was decorated for knowing his limits and performing well within them, despite the fact it was a "loss" for the Navy.
Sometimes you can't win...sometimes the best you can do is lose less.