How to do that shape correctly

 From:  Michael Gibson
9933.3 In reply to 9933.1 
Hi mdesign, to get a sweep without errors the profile curve can't extend a distance further than the radius of curvature of the bend.

For your case here that means the length away from the rail can't be larger than about this much:



One possibility though is to do the sweep that folds over itself, then use Edit > Trim with the "Isocurve" option to cut out the messy section:



Then you can put in a Blend there:







- Michael