Issue with Pagination – “No Path Back to Node” for endCursor

It’s not exactly the same, but I recently posted an example of how to handle loop iteration variables, which might help you figure out how to do what you want here. It should at least give you some ideas about how to reference things with expressions depending on whether they are inside or outside of your loop.