post your file please, otherwise it’s difficult to help you.
The problem is most likely because of the radius of your rail curve equals the width of your section.
I would try to make sure the radius on the section is larger, that way you have a 4 sided corner surface. On the screenshot below, the left corner surfaces are three sided, the right ones are 4 sided.
Let’s say you offset this surface and wanted to fillet that 90° inside edge or another edge that starts/ends in this corner, you will likely run into problems. Therefore I try to avoid surfaces like your 3 sided corner.