Collision doesn't always happen.

I have a ball and a rectangle with a 2D collider with rounded edges. When the ball hits the rectangle, I reflect the vector on the ball, so the ball will bounce off the rectangle.

When I launch the ball towards the corner of the rectangle where the ball passes by very, very close to touching the collider, most of the time the ball will just pass fine, but sometimes it actually detects a collision for some reason.
Why does that happen, is there a way to make it consistent?

On another similar note, when the ball hits the rounded corner, the reflected angle is like really weird, but only sometimes. I’m using a an Edge Collider 2D, could that be the reason?