You are close but you are using a repeating group on IN1 which is not a repeating segment. Remember INSURANCE group is repeating the segments within are not:
Try:
/.INSURANCE(0)/.IN1-1"
/.INSURANCE(1)/.IN1-1"
"/.INSURANCE(1)/.IN1(0)-1"
works because there's only one IN1 segment in the group (rep 0 defaults to the 1st segment in the group):
From the Terser api read up on the section on groups:
...
group_spec: ["."] group_name_pattern
Here, a . indicates that the group should be searched for (using a
SegmentFinder) starting at the current location in the message. The
wildcards "" and "?" represent any number of arbitrary characters,
and a single arbitrary character, respectively. For example, "M" and
"?S?" match MSH. The first group with a name that matches the given
group_name_pattern will be matched.
The segment_spec is analogous to the group_spec.
As another example, the following subcomponent in an SIU_S12 message:
msg.getSIU_S12_RGSAISNTEAIGNTEAILNTEAIPNTE(1).getSIU_S12_AIGNTE().getAIG().getResourceGroup(1).getIdentifier();
...
is referenced by all of the following location_spec:
/SIU_S12_RGSAISNTEAIGNTEAILNTEAIPNTE(1)/SIU_S12_AIGNTE/AIG-5(1)-1
/AIG(1)/SIU_S12_AIGNTE/AIG-5(1)-1 /AIG(1)/.AIG-5(1)
The search function only iterates through rep 0 of each group. Thus if
rep 0 of the first group in this example was desired instead of rep 1,
the following syntax would also work (since there is only one AIG
segment position in SUI_S12):
/.AIG-5(1)