I have found the solution for the bug, it's problem was AddSweep2 expects 2 lists, so if you input just 1 shape curve, it will fail, even though you might just need one.
You have to create a list out of shape curve(s), even though if you have only one shape curve.
rails = [r1,r2]
shape = [shape_curve]
def extrude_surfaces(self, u_strip, v_strip, mat_thick):
for u_i in u_strip:
edg = rs.DuplicateEdgeCurves(u_i)
r1 = edg
if not rs.CurveDirectionsMatch(r1, edg):
r2 = edg
shape = edg
lst_rail = [r1, r2]
lst_shape = [shape]