Incosistent response from MouseButtonUp,MouseButtonUp

I am trying to make a simple platformer game and the code for jumping is as follows.

    private void FixedUpdate()
    {
        
        if(onPlatform && Input.GetMouseButtonUp(0))
        {
            rb.velocity = new Vector3(rb.velocity.x, jumpForce, 0);
            Debug.Log("up");
            onPlatform = false;
        }
    }

The Problem: When I try to jump, 1 out of 5 times it does not jump and does not print “up”.

I have no idea why and any help would be much appreciated.
,

Do not check one time events in FixedUpdate. FixedUpdate does not necessarily run every frame and potentially miss events which are only true for one frame.

So move your code to Update