extraction of sheet metal along a curve

 

Hello,
I have drawn a 3D sketch of a curve that has a variable height from the base (dashed line) and is broken in several places.
I want to extend a sheet metal structure with a specified cross-section along its entire length

When I draw a second sketch and extrude along the curve, I end up with a deformed extrusion.

How can I fix this? 

I am disregarding the fact that at the moment I am doing this in the context of parts, later I thought about converting it to sheet metal. 

the height of the section you want to extract should match the height of the curve 

 

please, help