Unable to convert...into curve geometry - possible bug

I realise this probably isn’t going to be immediately super helpful:

But this is a good example of why not to use rhinoscriptsyntax for geometry modelling in GHPython. One issue is that jumping back and forth between guids and RhinoCommon types is confusing and needlessly complex. Another (arguably larger) issue is that it becomes really difficult to debug, because errors aren’t super explicit to their function (this is a good example of this). I’d advice trying to implement your algorithm directly in RhinoCommon. You can look up the rhinoscriptsyntax source code to identify the methods you’re currently using: