See OverlapSphereCommand, SpherecastCommand and so on.

The supplied results buffer is too small, there should be at least maxHits space per each command in the batch. issue:

Fix here