This is not always true, and often bugs (which are sometimes, but not always) can lead to incorrect results being published.
This is true of experimental and theoretical work.
In some fortunate cases, mistakes are found. For example, someone repeats a calculation and does not find agreement...