Problem: After filtering out all elements, ArrayIter:last still returns a stale element. Solution: Add check for self._head == self._tail and return nil early. Fix #34696
containerName