As far as I remember, in the late 19th century and the beginning 20th century, there was indeed some doubt about the validity of various theories about electromagnetism. Naturally in England there were many proponents of Maxwell's theory, while on the continent there were still strong proponents of other theories, based on an action-at-a-distance paradigm (particularly a theory by Weber). Among others it was Helmholtz, who initiated a research program to empirically figure out, which theory was right, triggering particularly the discovery of the electromagnetic waves by H. Hertz, which I think finally convinced a majority of physicists about the validity of Maxwell's equations.
Now indeed the problem with Maxwell's equations was that they cannot be made in any way Galilei covariant, i.e., one cannot find transformation laws for the fields and charge and current densities under Galilei transformations that keep the Maxwell equations forminvariant when changing from one inertial frame to another. The interpretation was that finally a means to determine Newton's absolute space and absolute time was possible using electromagnetic phenomena, and this preferred inertial reference frame was identified as the rest frame of the aether, which was thought to be a substance whose vibrations are the electromagnetic waves (light) like sound waves are the vibrations of air. This lead to theories describing how the Maxwell equations have to be modified when described in an inertial frame which is not this preferred aether rest frame (among others one famous was by Hertz).
The experimental challenge was that the corresponding phenomenology worked out nicely at the first glance, and it was pretty soon clear that one needed experiments sensitive at the order ##v^2/c^2##, where ##v## is the velocity of an inertial frame relative to the aether restframe. Famously the Michelson Morley experiment was such an experiment, and the null result was very unexpected, but still most physicists tried to stick with the aether model and adapting it with additional "mechanisms" like FitzGerald and Lorentz who introduced the idea of "FitzGerald-Lorentz contraction", according to which rigid bodies contract in the direction of their velocity wrt. the aether rest frame.
That explains, why Einstein titled his famous paper "On the Electrodynamics of Moving Bodies". Amazingly Einstein didn't argue with the Michelson-Morley experiment, which is not even explicitly mentioned in the paper, but with a symmetry argument, i.e., the interpretation of the induction of a current in a loop moving in the field of a permanent magnet vs. the same situation in a reference frame, where the loop is at rest and the magnet moving. Einstein just states that the asymmetry stated by the usual interpretations of Maxwell's equations are simply not there and the phenomena should indeed not depend on the motion wrt. some preferred reference frame or an aether-rest frame but just on the relative motion between the loop and the magnet. He also mentioned "unsuccessful attempts to discover any motion of the Earth relatively to the “light medium"" without specifying which he had in mind.
In any case Einstein's breakthrough was to assume the validity of the 1st Newtonian Law (special principle of relativity) and make it compatible with Maxwell's equations. Amazingly in the first part of the paper he just uses the most simple implication of this assumption, i.e., that the speed of light must be independent of the velocity of the light source wrt. any inertial reference frame, and from this he could derive the Lorentz transformations for space and time, i.e., the substitute for the Galilei transformations between inertial reference frames. Then he also gave the transformation rules for the electromagnetic field etc. The point was that one had not preferred inertial frame, which could be identified with Newtons absolute space and time or the rest frame of some aether, but that the laws of mechanics had to be adopted to the new spacetime model with the Lorentz (Poincare) transformations being the correct symmetry transformations rather than the Galilei transformations.