They aren’t lining up correctly because you are getting the slope using the scale, which is a non uniform quantity (it is stretched, not cube like) depending on the screen. Use offset instead.
If you still want the points to have scale like behavior, then position the points using scale and update the lines every frame with the points’ offset position values.