Is there examples of mathematicians who had to lose years
Vladimir Berkovich, as he writes "I finished studying in 1976 and got a Ph.D. a year later. Getting an academic position would be too much luck, and the best thing I could hope for was the job of a computer programmer at a factory of agricultural machines... As a result, I practically stopped doing mathematics." The context here being the he was Jewish in the Soviet Union and made trouble for him. He did not really start working on non-archimedean analytic geometry until 1985 and then did not really return to academia until 1987 when he was able to emigrate to Isreal.

The quote is from his introduction to: "p-Adic Geometry: Lectures from the 2007 Arizona Winter School" published by the AMS.