as @lokki already said...if you using 8 voices, then you are going to have duplicates
as essentially your doing 8 % 3.
so there are N (8 in this case) voices (set in your poly for the subpatch) , and voices are allocated based on the time that voice was used (i.e. oldest is used next), so once you've started playing a few notes, especially chords, the actual voice used will get tricky for you to track, as depends on exactly which order you released keys.
(so it is completely predictable, but easy to lose track of when your playing)
btw: what id recommend you do when your trying to debug these kind of things, is try to print something to the console log, e.g. my print object will help... this way you'll be able to see what polyindex is returning.
I think this would show you, you are not getting two voices with the same index