Adding dynamic labelling in load csv doubles the nodes count

I'm trying to load a set where row.type are the label of the node and it's dynamic in the set .

When I run the first part of the load I get the correct amount, but when I run the last part I get 2x nodes. 50% where the label is correct and 50% where the label is null

LOAD CSV WITH HEADERS FROM 'file:///nodes.csv' AS row
MERGE (node {id: row.id})
SET node += {
  name: row.name,
  behaviorsetdefinition: row.behaviorsetdefinition,
  acceptance: row.acceptance
}
WITH node, row.type AS label
CALL apoc.merge.node.eager([label], {id: node.id}) YIELD node AS labeledNode
SET labeledNode = node
RETURN labeledNode

What is your desired outcome, to create one node per row with the label from row.type?

What I believe is happening here is the cypher merge is creating a new node or matching one with the Id if it exists. The apoc merge is creating a new one because the one created by cypher doesn’t have the label. Does this sound reasonable?

If you goal is to create one node per row, replace the cypher merge with the apoc merge.