I need to digress from the hierarchy of knowledge story to discuss what is called the Replication Crisis, which you can read about at length here if you are so inclined. It primarily affected psychology, which is why I discuss it here, although it did affect educational (i.e. pedagogical) research and even biomedical research to some extent. In 2015 a project called the Open Science Collaborative tried to reproduce results of 100 widely cited studies in social psychology and found that only 36% of them could be replicated at all, and that even then the effect sizes were generally much smaller than the original report.
The problem is generally attributed to the incentives faced by investigators. They need to publish, and they need to get grants, which are mutually reinforcing requirements. Scientific journals have several "publication biases" that push investigators toward practices that can result in non-reproducible research. Editors favor positive results -- they aren't interested in studies that show that an intervention doesn't work, or a hypothesis is false. They favor dramatic results -- large effect sizes over small, novel and surprising findings. And they favor novelty -- they don't like to publish even positive replications, let alone refutations.
One response to these incentives, obviously, can be outright fraud, and that does indeed happen. For example, Dutch social psychologist Diedrik Stapel was found to have fabricated data for dozens of highly cited studies in prominent journals. Fifty-eight of his publications have been retracted, but that actually puts him only at number 8 on the Retraction Watch leaderboard. For some reason most of the leaders are Asian. The GOAT is the German researcher Joachim Boldt at 233, although his main problem was failure to secure IRB approval -- the research was not necessarily all fraudulent, but it was unethical. The U.S. champ is Adrian Maxim, a former electrical engineer.
However, blatant fraud is relatively uncommon. There are many ways to fudge data, not necessarily with consciousness of ill intent. Publication bias would result in a substantial amount of irreproducible research even without so-called "Questionable Research Practices" (QRP) because, as I said last time, positive results can happen purely by coincidence and those are the ones that are more likely to get published. But yes, plenty of QRPing does go on. I started to get at this last time when I talked about various ways study designs can be weak, but that isn't necessarily detectable from the manuscripts.
Probably the most common QRP is "p hacking," which basically means forming hypotheses after you do the research, when you already know what associations were significant. If you make many comparisons among different groups within your sample, you're bound to find some that are statistically significant, just by chance, but the p value is meaningless. Sometimes investigators don't tell readers, including reviewers and editors, that they did this.
The good news, however, is that the scientific establishment has become far more aware of these problems. Federally funded research now requires pre-trial registration, so you're hypotheses and methods are on the record before you begin. Journals, including and perhaps most particularly the most prestigious, are more willing to publish replications, refutations, and negative results. People are looking at their colleagues with more suspicion. The main end point, for me, is that science does often go wrong, but ultimately it corrects itself. Sometimes it takes longer than it should, but it does have a ratchet: we gain more and more accurate information over time. That's why you can read this, because I wrote it on a computer and posted it on the Internet.