Firstly, to be clear, I'm not trying to say that science is all nonsense or not useful or anything of the sort, since that's obviously not the case. If nothing else, it's incredibly useful for making accurate predictions about any number of phenomena.
However, it does seem to me that, to consider a scientific theory true (as opposed to just being useful) because it correctly predicts things about the physical world and has reasonable explanatory power is an example of the fallacy of the converse. Something like: if theory a is true, predictions x, y, and z must be correct predictions about the physical world. The predictions are correct, therefore a is true. That's a clear example of assuming the consequent, which is a common fallacy.
And yet, it surely can't really be so simple as that, because if it were then surely scientific realism would have been long since entirely rejected. So what am I missing that makes scientific realism reasonable?
There's Occam's razor of course, that a good theory should make as few assumptions as possible, and that, given the choice between two theories that both make the same predictions, the theory with fewer assumptions/independent parameters should be preferred. But that doesn't say anything about if multiple theories have the same number of independent parameters AND make the same predictions. Plus, while it's certainly true that, all else equal, if theory a makes assumptions A, B, and C and theory b makes those same assumptions but also assumes D, theory a is more likely, simply because P(A and B and C) ≥ P(A and B and C and D), just making fewer assumptions doesn't necessarily make a theory more plausible, since the specific assumptions made might themselves be implausible. Afterall, it's not necessarily true that P(A and B and C) ≥ P(D and E and F and G), even assuming statistical independence. And, finally, even if theory a is more likely to be right, that's not a guarantee it's right.
Basically, I just don't see how it's reasonable to think we could ever even know whether our theories are at least close to the truth or if we just keep making models that most closely fit the data we currently have but don't describe how the world actually is. What arguments does scientific realism make to refute these problems?