A YouTube playthrough of the game with the option enabled to always show their status effects captured the moment that they caught the zombie virus. Most lets-plays I've seen don't have the always-show-all-statuses option turned on, so it's rare to definitively capture the moment of infection.
https://youtu.be/LVhdVle3MNU?t=519
You can see at the moment they take the hit that they get "0% Sick" added to their statuses, which progresses to "Sick?" and then "Infected" later in the video. However, their health bar didn't appear at the moment they were hit, so they didn't actually take any damage (due to armour).
This suggests that the code tests for the chance of catching the virus whenever you are hit, rather than whenever you are damaged by a zombie, which seems off.
I must hate myself because I decided to play VEIN on the hardest difficulty. VEIN is a first person zombie apocalypse survival sandbox game that takes a lot of inspiration from Project Zomboid.
Watch me struggle and have fun at the same time!
Playlist is here:
https://www.youtube.com/playlist?list=PLLxMZBqbJESdyKa0RLyAPMumBzbtyRsgJ