In fact, assuming extra undetected mass to explain the anomalous motions of galaxies in clusters (as originally noted by Fritz Zwicky in the 1930s) was at least partly correct, because we now know that galaxy clusters contain rarified, extremely hot intergalactic gas (detectable only by its X-ray emission) in amounts equal to five or ten times the stellar mass of the galaxies. You still need even more mass in some as-yet-unidentified form (i.e., "dark matter") to fully explain cluster dynamics, but the basic hypothesis was at least partly successful.
(The "undetected mass" hypothesis also turned out to be successful in the cases of binary stars, including things like Sirius B, where the companion turned out to be a bizarre type of star never before seen or theorized.)
And, no, dark matter can't be distributed "arbitrarily": its distribution has to be consistent with gravity acting on an initially almost-uniform distribution with small cosmological perturbations (consistent with those seen in the cosmic microwave background).