BRepOffsetAPI_MakePipeShell fail to create a solid

Hello everyone, I would like to ask for some advice.

The attached picture shows a total of 6 models, 1-6.
1 and 2 get a solid 3 through BRepOffsetAPI_MakePipeShell
4 and 5 can only get a shell 6 through BRepOffsetAPI_MakePipeShell

Note
1)6 model, which has a face at the marked 7 position.
2)3 and 6 are both closed splines, and 6 is obtained by moving the two control points of 3 along the Z axis
3)The occt version I am using is 7.8.0

My question is, is there any way to make 4 and 5 generate a solid model? Many thanks.

Here is the code I use:
BRepOffsetAPI_MakePipeShell makesheel(BRepBuilderAPI_MakeWire(TopoDS::Edge(shape2)));
makesheel.Add(BRepBuilderAPI_MakeWire(TopoDS::Edge(shape1)), Standard_False, Standard_False);
makesheel.SetTransitionMode(BRepBuilderAPI_RightCorner);
makesheel.SetDiscreteMode();
makesheel.Build();
if (makesheel.IsDone()) {
makesheel.MakeSolid();
}
TopoDS_Shape newShape = makesheel.Shape();