As I said, on a cube, it will always be one color, since it’s closed.
Instead of working with 2 materials, since you are defining a custom shader, you can work with gl_FrontFacing
and set the material to backFaceCulling = false
to make sure it renders both sides :
As you can see it works on an open mesh (plane) but won’t work on a cube since any face is front facing, unless you go INSIDE the cube…