Camera Troubles: this.attached[i].detachControl is not a function at t.e.detachElement

Well, actually I experience a problem with my camera and my point&click function. Actually my console output says:
“babylon.js:16 Uncaught TypeError: this.attached[i].detachControl is not a function
at t.e.detachElement (babylon.js:16)
at t.detachControl (babylon.js:16)
at index.html:498”

whilest my code says:

var onPointerDown = function (evt) {
    //this was meant as a Fallback cause it said downwards, camera was not found :)
    scene.activeCamera.attachControl(canvas);
    console.log("myCamera: " + scene.activeCamera + "in line 486");
    
    if (evt.button !== 0) {
        return;
    }

    // check if we are under a mesh
    var pickInfo = scene.pick(scene.pointerX, scene.pointerY, function (mesh) { return mesh !== myGround; });
    if (pickInfo.hit) {
        currentMesh = pickInfo.pickedMesh;
        if(currentMesh.physicsImpostor.mass>=0){
        currentMesh.physicsImpostor.mass = 0;
        }
        console.log("this is currentMesh" + currentMesh.name);
        startingPoint = getGroundPosition(evt);

         if (startingPoint) { // we need to disconnect camera from canvas
            setTimeout(function () {
                 console.log("myCamera: " + scene.activeCamera + "in line 504");
                scene.activeCamera.detachControl(canvas);
            }, 0);
        }
    }
}

Camera was defined as:

var camera = new BABYLON.ArcRotateCamera("camera", 0, 10, 15, new BABYLON.Vector3(10, 7, 10), scene);
scene.activeCamera = camera;
scene.activeCamera.attachControl(canvas, true);

I would be thankful for any suggestions that can help me to fix and / or understand the problem :smiley:

Could you create a playground to reproduce the issue ?

This would definitely help a lot undestanding what is going on.