GL ERROR :GL_INVALID_OPERATION : glDrawElements: range out of bounds for buffer

I have this warning that came up recently in my project. I have found the generic (GL) explanation for this type of error but couldn’t relate it to what I have in my scene. Any smart ideas before I deconstruct the entire crap to try’n find the source? Thanks in advance for you input.

This is the link to my demo:

can you somehow reproduce it in the PG, it is really complicated to debug within external code where we have no access to source code

Thank you. Would have done that but just found the error. A simple left over from testing.

I had something like this:

var sphereMaterial = new BABYLON.StandardMaterial();
sphereMaterial.wireframe = true;
sphereMaterial.alpha = 0;

var positions = [
    new BABYLON.Vector3(-2.185, 0.1, -1.46),
    new BABYLON.Vector3(2.2, 0.1, -1.46),
    new BABYLON.Vector3(-2.2, 0.1, 2.76),
    new BABYLON.Vector3(2.2, 0.1, 2.76),

var spheres =, index) => {
    var sphere = BABYLON.Mesh.CreateSphere('sphere' + index, 1, 0.3, scene);
    sphere.material = sphereMaterial;
    sphere.position = position;
    return sphere;

Further down in the script, I have a function for my camera to target one of those spheres.
So, it was this simple (inappropriate) instruction that was causing the issue:

sphereMaterial.wireframe = true;

Sometimes, when getting those type of errors, one would look for something more complex, yes?
Well, the human brain is complex (and unreliable in my case, obviously;)

Thanks for taking the time to have a look and have a great day,