For me, the red plane is popping in and out of existence, which is caused by z-fighting issues.
You can avoid this by bringing the plane a tiny bit closer to the camera and expanding it a bit, then the z-fighting is solved:
addPoint(- w - 0.25, - h - 0.25, f - 0.01);
addPoint(w + 0.25, - h - 0.25, f - 0.01);
addPoint(- w - 0.25, h + 0.25, f - 0.01);
addPoint(w + 0.25, h + 0.25, f - 0.01);
I don’t think that drawing something that lies exactly on the far plane should be expected to give good results, at least without using a shader material.
The precision for perspective projection gets worse the nearer to the far plane that you go, so by placing something on the far plane, you are basically going to get the worst precision problems possible for that frustum, although perhaps if you make the frustum smaller they can be reduced enough.
You could perhaps avoid this by using a shader material instead.
If you explain more clearly what you are trying to do it will be easier to help you.