The major problem with virus is that they mutate and that there are several "sub species".
If you take the Influenza for example, they are every year 8-10 different Influenza in 4 type (A,B,C,D) all under the same public name : the Influenza. for France, the vaccine concerned the 4 majors kinds (A and B type) (I think last year (2018-2019) it was 6 kinds) and is valid for about 1 year as the virus mutate. That's why we have a new vaccine every year. Labs have to do the job every year for each kind of virus and create a new vaccine.

But if the virus mutate faster, then you can be sick two times but not from exactly the same virus (or you can be vaccinated and get sick later anyway)