Nth0/3 implementaion in swi-prolog

I do not understand how the limit on number of parameters will apply in this situation.