@peterimg, I agree with @Evgeni_Popov that the shader approach to triangles will not approximate a line renderer. The simple fact that you have a quad with a width of 0.005 means you have very little screen area covered by that mesh when it is near the camera and while it recedes from the camera, the perspective of the camera will make the mesh appear thinner as the width remains constant while the distance to camera increases.
Whereas the line renderer just renders a line between two points on the screen, it doesn’t matter what the distance from the camera the world coordinates are because those coordinates are projected to screen space and a 2D line is drawn between them. This is why the line remains a constant width no matter where the endpoint coordinates are.
The only way to achieve this with a quad is to create the quad as a trapezoid so that the end further from the camera is wider than the end near the camera. This will serve as a counterbalance for the projection distance in perspective from appearing to converge and not render once the width is smaller than a pixel.
However, I have to ask what you are trying to achieve with this technique as we can talk about how render this correctly in an abstract way, but we may not actually be solving your problem unless we know a little more context. I am not convinced about why you need a custom shader for a mesh material on a quad that thin. Other than color, there is not much to be gained with a custom shader on a quad that small. What is it you are trying to achieve? Do you need to be working with depth like this? Can a 2D approach work for you in case you are doing something like UI overlays drawing lines to meshes in a scene to label them? Are you creating a track for a racing game? Even a little more context into what you are doing may unlock a solution we aren’t thinking of when trying to solve this particular problem.