The message.removeAllNodes() function will remove all the nodes in the message object, not just the specific one you're working with in your loop. The node path 'INS[group=!INS]' will match all the nodes from one INS segment to the next as a series of groups, but when you pass that node path to a removeAllNodes() function, it will find those groups and remove them all.
The best way to split messages is to first get the groups (which you're doing with your message.getAllNodes() function), remove all the groups from the message object, and then add back in just the items you want included in the message. You'll likely want to use qie.spawnNewMessage() to create a new message object with your segments added back in.
For an example of splitting a single message into multiple messages, see this KB, which is for HL7 but will be useful as an example.