Migration | Custom transformation crashes due to non cascading persist operation

I need to transform data from an old codebase to a new one. One Step is to split one NodeType into to others. I create the new node by calling

$newNode = $parent->createNode($nodeName, $this->nodeTypeManager->getNodeType(<NodeTypeName>));

After the migration states to have been run successfully i get the error

A new entity was found through the relationship ‘Neos\ContentRepository\Domain\Model\NodeData#workspace’ that was not configured to cascade persist operations for entity: Neos\Flow\Persistence\Doctrine\Proxies_CG_\Neos\ContentRepository\Domain\Model\Workspace@4816.

Explicitly calling EntityManager#persist() on the created nodes throws the exception

No class schema found for “Neos\ContentRepository\Domain\Model\Node”.

  • What’s the proper way to create and persist child nodes?
  • Could “broken” workspaces from the old DB make the Transformation fail? If so, is there a way to delete personal workspaces?

Kind regards!