How smoothly we transition into and out of turnouts is a major factor in creating derailment -free operation. Note both the length of the curve between the turnout and siding as well as the smoothness of the curve and lack of kinks. The curved transition track shown is about ten inches long.
Trains run on track and keeping things on the rails is the foundation of creating an enjoyable operating experience. Derailment-free operation comes not only from careful construction but subtle design approaches as well. Specifically, how we transition from curved track to other elements such as turnouts and lift out bridges. Closely related is how we transition from turnouts into sidings as shown in the image above.
Ideally, it's best to avoid placing a turnout directly adjacent to a curve (left). You'll get better performance if you place a straight transition piece between the two as shown on the right. How long should the transition piece be? It's not an exact science but I'd shoot for something in the four to six inch long range.
If your design features an around-the-walls shelf configuration you'll most likely need a lift out bridge somewhere. It's common to have a situation where the room entrance is in the corner which means having a curve right before the bridge. Going directly from the curve to the bridge as shown on the left gets risky from a reliability standpoint. It's far better to insert a straight transition piece between the curve and bridge as shown on the right.