Does this one work as you need it to? The custom state is of type number instead (set on the Repeating Group Event element), and is set to 1 on page load. Then the up and down arrows change the value depending on how many cells are in the repeating group (and sets back to 1 if the User clicks the ‘down’ when they’re already on the last item in the rg)
Preview:
Editor: