There seem to be problems in Collect with how complex expressions in nested repeats are evaluated. These are being explored currently (e.g. How to count repeats in a inner field - #7 by ggalmazor).
In the mean time, I would encourage you to either ask the user ahead of time for a count of values for the inner repeat or let them add the new instances of the inner repeat as long as they have new ones to add.