Raycasts not always hitting small objects

Hi, i’m making a game with interactable Rigidbody items including keys, boxes, etc. The Player sends a raycast along the camera transform to detect the key, but it doesn’t always detect it. The box detection works fine, and both objects have BoxColliders. I tried Debug.DrawRay and the raycast sometimes goes right through the collider without detection! Everything is on the same layer. What am I doing wrong?

Never mind, I fixed it. My key had a non-uniform scale, which seems to mess up small-object RayCasting.