Do you mean that the line is not always visible? It’s probably related to this issue: https://gitlab.kitware.com/vtk/vtk/-/issues/18441
Using the following properties for the lines should fix it:
resliceCursorRep[i]->GetResliceCursorActor()->GetCenterlineProperty(0)->SetRepresentationToWireframe();
resliceCursorRep[i]->GetResliceCursorActor()->GetCenterlineProperty(1)->SetRepresentationToWireframe();
resliceCursorRep[i]->GetResliceCursorActor()->GetCenterlineProperty(2)->SetRepresentationToWireframe();