I can’t say why the camera is flying again to the same location as you’ve not shared any sandcastle example.
I think you need to play with camera position. You can get current position of the camera and then multiply that position’s height and set it back to the camera. Check my reply on this post for detail.