node
is 'mainShape_00'
because at that time, that's what it's named. There is no collision until it's parented under nodeGroup
. Grab the real name after parenting:
node[0] = cmds.parent(node[0], nodeGroup, relative=False)[0]
This substitutes the original node[0]
with the newly parented node[0]