Vortex - issue with vector shift

I don’t get the vortex puzzle

I made a simple implementation which works for the 2 first tests, for the third I used the fact that shifting N times a M sized vector equals to shift N%M but it seems wrong and I don’t really get why.