Detail curve getting off placed

I am creating a detail curve with Revit using python script. first curve generated by curve is getting off place no matter what curve i have given first. what can be the reasons to happen like that?
Python script
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *

clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

curves = UnwrapElement(IN[0])
views = UnwrapElement(IN[1]) if isinstance(IN[1], list) else [UnwrapElement(IN[1])]
elementlist =
doc = DocumentManager.Instance.CurrentDBDocument
TransactionManager.Instance.EnsureInTransaction(doc)

doc_create = doc.Create
for view, curve in zip(views, curves):
temp_list = # Temporary list to store detail curves for this view
if len(curve) != 0:
for c in curve:
detcurve = doc_create.NewDetailCurve(view, c.ToRevitType())
temp_list.append(detcurve)

# Append temp_list even if it is empty
elementlist.append(temp_list)

TransactionManager.Instance.TransactionTaskDone()

Filter out None values from elementlist if needed

OUT = elementlist

What is your IN[0] and IN[1]?
It would be helpful if you could share the screenshot of your Dynamo graph