The years spent as a grad student and postdoc are among the most trying times for any scientist. The pressure to publish is intense, as young researchers vie for the few jobs at the heads of academic labs.

Those high stakes and the pressure-cooker atmosphere make mistakes — and sometimes the willingness to cut corners and commit fraud — more likely.

Unfortunately, both can be career killers, if two recent cases are taken as examples. And although fraudsters aren’t welcome, the loss of the innocent overwhelmed is taking a toll on science.

Case one: Sergio Gonzalez, a postdoctoral researcher at the Institute for Neurosciences of Montpellier, France. He was hitting the job market in 2015, and he knew he needed a paper in a top journal to stand out in that market.

So he was relieved — elated, perhaps — when editors at the Journal of Clinical Investigation, one of the world’s most prestigious journals, told him they’d be publishing one of his papers. Having an article accepted there would carry a lot of weight on a job application — and in France’s system, success on that application meant a permanent job.

But the paper was flawed — deeply, it turns out. First, a commenter on PubPeer, an anonymous post-publication peer review site, flagged a suspicious-looking figure. Next came a correction in the journal, more comments on PubPeer, an expression of concern from the editors, an institutional review of Gonzalez’s work, and finally, this month, a retraction. Along the way, Gonzalez lost the opportunity for the job he so wanted.

Around that same time, across the Atlantic, another grad student was also on the academic job market. Michael LaCour was a promising graduate student in political science at the University of California, Los Angeles, who managed to publish a headline-grabbing paper in Science, one of the world’s top journals, about attitudes toward gay marriage. Soon after that, he landed a job at Princeton. But then his paper — and academic career — unraveled after two other graduate students at different institutions starting asking questions that would eventually make it clear LaCour had made up the data. The paper was retracted — and so was his job offer.

LaCour’s story and Gonzalez’s take different paths from there. While LaCour, it seems, faked his data, through it all, Gonzalez and his supervisor, Nicolas Tricaud, maintained that the postdoc was innocent of misconduct. Any errors, Tricaud insisted, were the result of Gonzalez’s haste and stress over his impending job search and his desire to land a plum spot.

The university seemed to agree that Gonzalez was honest but sloppy. According to the JCI’s retraction notice: “The institutional review found no evidence of intention to falsify results and concluded that errors were made due to negligence during the assembly of figures. The institutional review panel did not question in any way the authenticity of the published results.”

We may feel relieved that LaCour seems unlikely to return to the ivory tower. But the loss of Gonzalez, who did not win a coveted spot in a laboratory, seems by all accounts to have been a blow to science. Tricaud says the budding researcher has dropped out of academia — a shame considering his willingness to “work like hell” on the project.

It’s not just France where postdocs feel this pressure. In the US, only about 15 percent of postdocs can expect to land faculty jobs, according to one estimate. Meanwhile, the rate of unemployment among this group jumped from 4 percent in 2008 to 10 percent in 2012.

Part of the problem is that academic mentors tend to emphasize careers in academia, rather than all of the other doors a PhD can open. So when someone like Gonzalez is shut out of the academy, they feel the failure even more acutely. One solution would be for such mentors to embrace so-called “alternative careers,” whether in industry, public service, or elsewhere — which aren’t really “alternative” anymore, given that most PhDs end up in them.

But if senior faculty and administrators don’t want to drive young scientists from the field — even the honest ones — they’d best figure out a way to let publish or perish itself perish.