A theory is a body of work, and to reach the status of being accepted as a theory it will have undergone considerable testing. It will not be junked just because of a small anomaly (and even then it would need to be shown that the anomaly was not just a freak event). Instead it will be adjusted to handle that anomaly if that is at all possible. In fact it won't be junked unless there is a clearly better alternative available.
Even then it may hang on if it is useful.
For instance we still teach Newtonian mechanics - and that theory is still widely used - even though it has been superseded by General Relativity. Being a good enough approximation for many situations - and easier to work with - has kept it alive.
General Relativity itself has a severe problem - it cannot be fully reconciled with Quantum Mechanics. Yet it is still used - partly because there are many cases where the problems don't matter, but also because there is no replacement available (although scientists do try to work with possible replacement theories this work is mainly in evaluating those theories, rather than simply using them).
An anomaly that has been solidly confirmed, and which cannot be accommodated by adjusting the theory will, at most, start scientists looking for a replacement for the theory. So long as the current theory is the best available it will continue to be used.