Curve offset gives unexpected results

Hello!

I am trying to perform a range of curve offsets from a vertical S-shape. (see image below) When performing the offsets, grasshopper doesn’t offset the curves correctly. I haven’t successfully been able to explain how I want the offset to work in the corners and it gives unexpected results.

I’ve been trying different solutions, like rebuilding the curve, offsetting without the filleted corners etc, but so far none yield the expected result.

Does anyone know how to avoid this problem?

I’ll work around it for now, but of course there might be a better way of doing what I intend, if so, feel free to give suggestions. And how would I get the offset to understand how to treat the corners?

The curve

The weird offsets

Offset curve fail.gh (15.0 KB)