Scene is modified within a rendering callback of another scene - what does this error mean, and how to fix it?

Here is my code. The object assigned to pokeNode is half buried in the plane assigned to planeNode. Therefore I was trying to change the position of the pokeNode so that the object can be lifted. However, I ran into the 'scene modified within a rendering callback of another scene' error. Does anyone know what this error means (I checked similar questions and no one explained what this error actually means)?

For now, I have found a workaround by going to scene editor and changing the transforms parameter(position).

scene editor

I know I can also write a line like this to achieve it pokeNode.pivot = SCNMatrix4MakeTranslation(0, 0, -pokeNode.boundingSphere.radius)

However, I feel like what I'm doing is just a workaround but not the real solution. Anyone has an idea of how a real solution would look like?

        let node = SCNNode()
        if let imageAnchor = anchor as? ARImageAnchor { //check if anchor detected is an image anchor
            let plane = SCNPlane(width: imageAnchor.referenceImage.physicalSize.width, height: imageAnchor.referenceImage.physicalSize.height)
            plane.firstMaterial?.diffuse.contents = UIColor(white: 1.0, alpha: 0.5) //dimming the card when detected
            let planeNode = SCNNode(geometry: plane)
            planeNode.eulerAngles.x = -.pi/2 //eulerAngles is a node's orientation; we can leave 'Float' out when calling pi
            node.addChildNode(planeNode)

            if let pokeScene = SCNScene(named: "art.scnassets/pikachu.scn") {
                if let pokeNode = pokeScene.rootNode.childNode(withName: "pikachu", recursively: true) {

                    pokeNode.position = SCNVector3(x: planeNode.position.x, y: planeNode.position.x + pokeNode.boundingSphere.radius, z: planeNode.position.x)

                    pokeNode.eulerAngles.x = .pi/2
                    planeNode.addChildNode(pokeNode)
                }

            }
        }
}

and I know this line is causing this error:

pokeNode.position = SCNVector3(x: planeNode.position.x, y: planeNode.position.x + pokeNode.boundingSphere.radius, z: planeNode.position.x)
Scene <SCNScene: 0x281cd2040> is modified within a rendering callback of another scene (<SCNScene: 0x281cc0540>). This is not allowed and may lead to crash