Problem Collision

I have a problem with the collision of two 2D sprites.
I leave you a video to make you understand my problem:

As you can see, the collision is not perfect, and the square many times enters the block below. The collision is not precise.
I leave here also the code I use:

public float jumpHeight = 40f;
public float gravity = 1f;
float JumpVelocity;

private void Awake()
{
rb = GetComponent<Rigidbody2D>();
}

private void Update()
{
AddGravityToPlayer();
}

private void OnTriggerEnter2D(Collider2D other)
{
if(other.gameObject.tag == "Block")
{
if (rb.velocity.y <= 0){
JumpVelocity = gravity * jumpHeight;
rb.velocity = new Vector2(0, JumpVelocity);
}
}
}
private void AddGravityToPlayer()
{
rb.velocity = new Vector2(0, rb.velocity.y - (gravity * gravity));
}

Where am I wrong?

Edit:
I tried to set up the collision detection of the player on continuos, but the result does not change.

That is because of discrete collision detection. Continuous collision detection doesn’t work with triggers as it cannot because continuous requires the body move to the point of contact and there is no collision response for triggers. It does seem odd that platforms are set to be triggers assuming they are.