Problem with Point in custom shader

Hello everyone! I have a problem when displaying Points. When I move away from the camera at a certain distance, my Points disappear. What could be the problem?

const geometry = new BufferGeometry();
    geometry.setAttribute('position', new BufferAttribute(new Float32Array([position.x, position.y, position.z]), 3));

    let vertexShader = `
        void main() {
        vec4 viewPos = modelViewMatrix * vec4(position, 1.0);
            float size = 200.0 * length(viewPos.xyz);
            size = clamp(size, 200.0,  2000.0);
            gl_PointSize = size;
            gl_Position = projectionMatrix * viewPos; 
        }
    `;

    let fragmentShader = `
        void main() {
            vec2 coord = gl_PointCoord - vec2(0.5);
            float distance = length(coord);

            if(distance > 0.5) {
               discard;
            }

            gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
        }
    `;
    let material = new ShaderMaterial({vertexShader, fragmentShader});
    const point = new Points(geometry, material);
    point.frustumCulled = false;

perhaps the problem is not in your shader code.
show how you move the camera, and how did you create your Perspective or Orthographic camera.

This demo uses a similar shader to yours. The particles disappear because the camera far plane is set to small.

new PerspectiveCamera(75, window.innerWidth, window.innerHeight, 0.1, 5000000);