Please help surface nulls

I am trying to create a curved surface based on a curve using a script, and inside I had a problem with null points. I am trying to do that by using the distance from the curve that creates the surface.

Welcome to this forum!
Please read here Help Us Help You
Attach your .gh here with internalized geometries. (see the video on point 3 )
It’s hard to help you without seeing the actual file.