It was less of a counterexample and more of an inaccuracy. It wasn't immediately obvious as to whether the theory was at fault or our measurements or even knowledge of celestial objects (e.g. maybe Mercury had some nearby object that was changing its orbit).
Also, there wasn't any alternative, so a theory that explains almost everything is going to be accepted. Modern theories are also accepted if they explain things with more accuracy or over wider ranges than alternatives - often it's the shortcomings of theories that gives us clues as to a better theory. (e.g. the ultraviolet catastrophe)