When you horizontally scale the profile to a line, the horizontal segments become segments of zero length. Grasshopper recognizes these segments as invalid, and rebuilds the profile without them. Out of a profile of formerly 6 sides, you get a closed loop of 3 vertical colinear lines and attempting to create a loft or a ruled surface between the profiles expresses this mismatch.
In my second solution, I attempted to circumvent disappearing profile segments by creating lines between the discontinuities of the original profiles and their translation to over the origin ({0,0,x.z}); then spanning between the them with ruled surfaces. Yes, the section of that script that baffles you is just data manipulation that pairs consecutive lines around the figure into branches so that they can be appropriately fed into Ruled Surface.
The problem with this is that it only works with polygnal profiles,:
firstly, because the onset of the fillet in the profile is not a discontinuity, and, secondly, because this method does not allow for any curved surfaces.
The third and final solution is akin to the first, only that I am directly defining the translation of individual segments of the original profile as lines over the origin. The problem of horizontal segments translating to points still exists, but unlike when they are part of a larger curve, they get interpreted as a point instead of getting blinked out of existance. This is the solution I suggest you use.
You can also just not project your profiles to a line. This is the approach that @leopoldomonzani has taken, but can be more simply expressed thusly:
Extrude a Closed Curve to a Line VR 4.gh (16.3 KB)
where the compound transformation being used is a mirror across the XZ and the YZ planes (order insignificant).
Interestingly, if you set the tween to 0.5 (that is when tween is a line over the origin) a single untrimmed surface can be successfully created! But the surface is wierd – Grasshopper refuses to create a closed surface from it by capping because the “open” end which is the line above the origin is self intersecting.