I had the same problem.
Using clamp(-1.0 + eps, 1.0 - eps) instead of clamp(-1.0, 1.0) made it for me…
clamp(-1.0 + eps, 1.0 - eps)
clamp(-1.0, 1.0)