I’ll try to explain it with a quick example. It is a pretty basic function with 2 variables. I’ve repeated it 4 times and in each case the only difference is the definition of the input variables.
So in the first case the function knows to expect two lists. Everything works as expected. The while function evaluates the first list. The first list is longer and that is why the last index of the result is null - because the second list doesn’t have a corresponding index.
In the second case neither of the input parameters are defined. Therefore each element from your input lists is evaluated on its own and because it’s a non-list single element, you get null values when you try to index it.
In the last two cases either one of the two input parameters is defined as a list. The function fails in both cases because you are trying to index a non-list single element again. However it’s interesting to note that the output is formatted differently because your input parameters are not the same length and that affects the lacing of the output.
I hope I didn’t confuse you more. Maybe someone will come up with a better example than this.