Line/polyline from Sample Line?

The reason you’re getting the index out of range error is because the node is expecting two inputs, but you’ve only provided one.

Capture

Please see this post: