UPDATE: doesn't work entierly!
I solved this by setting the camera's transparency sort mode to orthgraphic:
Camera.main.transparencySortMode = TransparencySortMode.Orthographic;
Works for both LineRenderer or using a deformed cube.
https://docs.unity3d.com/ScriptReference/TransparencySortMode.html