I updated the triplanar grid shader on gist with a fix for that, as well as some other improvements. Including using derivative based flat normals by default. That is technically the more correct way of doing it. But the reason why you were probably seeing more issues when you did it yourself is because derivative based flat normals can have some noise in them due to precision limitations, which were also causing the noise you were seeing. The updated version shouldn't have issues with either.