Loop block index error in Genesys Cloud Architect Data Action

Trying to iterate over a JSON array returned from a custom Data Action using the Loop block. The payload looks fine in the debug logs, but the loop fails immediately with an index out of bounds error. Here’s the snippet:

Loop Start: items = $.response.data
For each item in items:
 Assign $.output.count = $.output.count + 1

The array has 3 items. Why is it choking on the first iteration? Checked the schema, it’s definitely an array. Stuck.