Apply some rubberducking here.
On the left edge, you UV.r value is zero. Subtracted 0.5, it becomes -0.5, absolute of which is 0.5. lerp between 1 and 0 on 0.5 is 0.5.
In the middle, you UV.r value is 0.5. Subtracted 0.5, it becomes 0.0, absolute of which is 0.0. lerp between 1 and 0 on 0.0 is 1.0.
On the right edge, you UV.r value is 1. Subtracted 0.5, it becomes 0.5, absolute of which is 0.5. lerp between 1 and 0 on 0.5 is 0.5.
So, everything works as intended.