You are correct, this is how it behaves. For my dev mind (probably for others ) this was pretty non intuitive. In the end I used array_length and sum to compute the count.
Still, is this the intended behaviour (I guess so from a mathematical point of view ?? )? If it is I can argue that is not too intuitive and adding a doc note near the unnest function description would be good.
Yes, its intentional, and it isn't specific to just the unnest function so documenting it just there doesn't seem correct. I don't know where it is documented but I suspect that even just reading the documentation for this would be of minimal help - I think its likely best learned after experiencing the aforementioned problem.