Similar to PHPC-2456
Reproducer
$orderby = ['$orderby' => ['x' => 1]]; new \MongoDB\Driver\Query([], ['modifiers' => ['$orderby' => &$orderby]]);
Result
PHP Fatal error: Uncaught MongoDB\Driver\Exception\InvalidArgumentException: Expected "$orderby" modifier to be array or object, bool given