Setting up for failure: automatic discovery of the neural mechanisms of cognitive errors