Can't get Physics2D BoxCastNonAlloc to work

I’m trying to use a boxcast on a beam weapon of width > 0. Using a raycast for this beam test works correctly, but the BoxCast returns zero results.

I’m not using any depth, distance, or layermask filters.

colCountRay = Physics2D.BoxCastNonAlloc(e.pos, Vector2.right, 0, Vector2.up, collsRay);
colCountRay = Physics2D.RaycastNonAlloc(e.pos, Vector2.up, collsRay);

I’m using this script to visualise the box cast and it’s overlapping correctly…

I’ve used boxcast before in another game so I’m completely stumped here! All the tested objects have 2D colliders and a kinematic rigidbody.

Answered on StackOverflow, I have a box of size (1,0) which registers no hits. When you think of stretching out a beam, this shouldn’t matter but it does. A vertical size of the box of 0.001 seems the minimum for registering hits for me.

colCountRay = Physics2D.BoxCastNonAlloc(e.pos, new Vector2(1,0.001f), 0, Vector2.up, collsRay);

…works.