it is far from obvious when a theory should be discarded in light of conflicting evidence, rather than rejecting some other assumption used to make the prediction.
Not difficult at all: When the theory is incompatible with the evidence or a different theory provides a better explanation for the evidence.