That shows some more illustrations for how you would want to position the profile to get what you want.
I've also attached a model file here with the profile positioned how I think you want it - try sweeping the profile in the attached 3DM file to a result that goes towards the inside of the rail, because the profile is touching the rail and positioned to that side of it.