The most common and most likely answer to this crossword clue is the 10 letter word POSTMORTEM
I've seen this crossword clue in Independent
P
O
S
T
M
O
R
T
E
M
Buddy explains!

The straight part
We know that "By which to find what went wrong" is the straight/definition part of the clue. The straight part is often a synonym or definition, in this case by which to find what went wrong = postmortem.The cryptic/wordplay part
In cryptic crossword there's often an wordplay/cryptic part as well.This part involves a more complex hint, such as an anagram, homophone, hidden word, etc.
Sadly, We don't have an explanation for this specific crossword clue yet.
What does POSTMORTEM mean?
POSTMORTEM noun- An investigation of a corpse to determine the cause of death.
- Any investigation after the conclusion of an activity, particularly when said activity produces an unwanted outcome.