Thank you, walroos and Kal_Man.
The indexed-repeat works fine except that it takes the numeric code (of crop) as output. However, what I wanted to output is the label (of crop code).
Below code works fine:
I finally got it! The issue was that jr:choice-name() cannot be combined with indexed repeat. I added a new calculate step for jr:choice-name() in the first repeat which will be called in the indexed repeat code in the second repeat.
Attached, the code for those who might be looking for answers.