You raise an interesting point about the role of experiment and falsifiability in science. Despite a long-standing anomaly in Mercury's perihelion, Newton's theory of gravity itself wasn't heavily questioned, let alone rejected or falsified. Rather, auxiliary assumptions were concocted that saved Newton's theory, such as an erroneous mass of Venus, a planet inside Mercury's orbit and that Mercury had a moon.
Imre Lakatos developed this idea in his criticisms of falsifiability, see e.g.
Auxiliary hypotheses are
considered expendable by the adherents of the research programme—they
may be altered or abandoned as empirical discoveries require in order
to 'protect' the 'hard core'.
Lakatos was following Pierre Duhem's idea that one can always protect
a cherished theory (or part of one) from hostile evidence by
redirecting the criticism toward other theories or parts thereof
(wiki)
Kuhn explicitly discussed the case of Mercury's perihelion in his seminal The Structure of Scientific Revolutions (1962):
No one seriously questioned Newtonian theory because of the
long-recognized discrepancies between predictions from that theory and
both the speed of sound and the motion of Mercury ...
[The discrepancy] vanished with the general theory of relativity after a crisis
that it had had no role in creating.
Einstein, for example, seems not to have anticipated that general
relativity would account with precision for the well-known anomaly in
the motion of Mercury’s perihelion, and he experienced a corresponding
triumph when it did so
The development of general relativity followed from theoretical inconsistencies between Newton's theory and Einstein's relativity, rather than evidence that contradicted Newtonian theory.
That said, Newton's theory didn't have to wait for Einstein for theoretical criticisms. Even in Newton's day, his theory was criticized on conceptual grounds as being "occult," for it permitted action at a distance, especially by Leibniz. However, Kuhn suggests that these criticisms died away and only returned in light of general relativity:
When Newton’s theory had been accepted, a question [the origin of gravitational attraction] was therefore
banished from science. That question, however, was one that general
relativity may proudly claim to have solved.