First, AE's 3D world is set so the ground plane is X, Y. If you have a camera move with a 2 node camera, which is a camera with a point of interest, the camera is designed to primarily move around on the X - Z plane. If you flip the ground plane to X, Y and try to move the camera primarily in that plane you will experience gimbal lock and the camera will flip over. In a lot of 3D apps the primary ground plane is X, Y so some folks get confused.
Second point, the orbit tool moves the camera around the point of interest making the point of interest the center of the arc. That is all that it does. Open up two views, Active Camera, and Left, then select the orbit tool, center it in the Active Camera view and drat it up or down until the camera passes directly over or the center of the point of interest. Observe the Y (green) axis pointer on the camera and you will see it flip from one side to the other. This is Gimbal Lock. The camera is attempting to stay right side up, which is what a camera operator would attempt to do in the real world. This is normal.
If you want the camera to keep from flipping over the easiest way to do that is to select the Camera layer, reset position, then use the menu to go to Layer>Camera>Create Orbit Null. Now use the rotate tools on the null to move the camera around.
If you are going to do a lot of 3D camera work I strongly suggest that you type Animate Camera in the search help field at the top right corner of After Effects and check out the help files and community resources. A couple of hours going over exactly how AE's camera and 3D world works will save you days of frustration. If you are looking for tutorials be sure and vet your trainers. There are at least as many awful animate the camera tutorials on YouTube presented by amateurs that don't know what they are doing as there are good ones by folks that actually teach productive and effective workflows.