Ellipse does strange things in my code

I was coding in my app and added an ellipse. This strange thing happened to the ellipse:

So I reproduced the same exact code in Sandcastle and it does not happen, as you can see here.

What is causing this? I suppose it is something of the settings, but I dont know :frowning:

Thanks in advance!

I realised it is because in my code
viewer.scene.globe.depthTestAgainstTerrain is set to true