Why rigidbody2D.velocity passing through collider2d boundary but not rigidbody2D.AddForce

In my project I’m updating rigidboy2d up velocity inside FixedUpdate method, but it is not stopped by collider2d, which I’ve set as boundary.

void FixedUpdate()
    rigidbody2D.velocity = Vector2.up * 10;

But when I change the code to rigidbody2D.AddForce(Vector2.up * 10, ForceMode2D.Impulse); it is successfully stopped by collider2d. I’ve set the rigidbody2D.isKinematic as false before updating its velocity. Could anyone please why this happening?

Velocity changes are appropriate only under certain conditions, and is rarely-if-ever appropriate in code which runs every frame. Writing to velocity is a way of bypassing the rules of the physics simulation. In other words, you should not expect such bodies to interact in an accurate manner.

I didn’t realize it would allow “ghosting through” colliders any moreso than AddForce, but I suppose that shouldn’t be surprising. Ghosting is a well known issue which is chiefly addressed by reigning in average top speeds and building good colliders and environments.