Reorder the posts in grid to prioritise those with assigned custom field value – WordPress, WPgridbuilder, ACF

I’m using a WPgridbuilder plugin to create a custom grid together with ACF to add custom fields to the post type.

I’ve got a grid that shows all ‘Books’ (custom post type).

I’m using ACF to add a checkbox field “promos” to the Books post type, here I’ve got a value “new”.

What I’m trying to achieve is to reorder the posts in the grid, so the grid first shows all posts with the selected value “new” and then all other posts in a random order.

This is what I currently have:

function grid_query_include_post_ids( $query_args, $grid_id ) {

    // If it matches grid id 14.
    if ( 14 === $grid_id ) {

                // The grid is also queried during Ajax requests when filtering or rendering facets.
        // So we have to get the ID of the current post/page thanks to the referer.
        $referer = wp_get_referer();
        $post_id = wp_doing_ajax() ? url_to_postid( $referer ) : get_the_ID();

        // Retrieve the 'promos' (or 'field_64c25438d2c3a') value for the current post.
        $promos = get_post_meta( $post_id, 'promos', true );

        // Check if the 'new' value exists in the 'promos' array.
        if ( in_array( 'new', (array) $promos ) ) {

            // Display posts assigned to the custom field value 'new' first.
            $query_args['meta_query'] = array(
                array(
                    'key'     => 'promos',
                    'value'   => '"new"',
                    'compare' => 'LIKE',
                ),
            );

            $query_args['orderby'] = array(
                'meta_value' => 'DESC', // Display 'new' posts first.
                'rand'       => 'ASC',  // Random order for other posts.
            );

        } else {

            // Display all posts in random order.
            $query_args['orderby'] = 'rand'; // Random order.

        }

    }

    return $query_args;
}

add_filter( 'wp_grid_builder/grid/query_args', 'grid_query_include_post_ids', 10, 2 );

The function is based on the official WPgridbuilder query docs here

I can’t seem to make it working. The posts are still showing up in random order regardless of the custom field value.

Any ideas what I’m doing wrong?