There are tons of papers showing the exact opposite of what you said if actually cared to look.
Knowing whether someone is vaccinated against COVID is not going to help you predict whether they have been or will be infected. Knowing whether someone had the smallpox vaccine is going to help you predict whether they had been or would become infected. See the difference?