WP_Query – Exclude Posts

You’ll need a second tax query for posts not in the child categories of the given category. To do that you’ll need to get the IDs of the children. This is possible with get_term_children():

$args = [
    'post_type'      => 'post',
    'post_status'    => 'publish',
    'posts_per_page' => $post_number + 1,
    'paged'          => ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1,
    'tax_query'      => [
        [
            'taxonomy'         => $taxonomy,
            'field'            => 'term_id',
            'terms'            => $category_id,
            'include_children' => false
        ],
        [
            'taxonomy' => $taxonomy,
            'field'    => 'term_id',
            'terms'    => get_term_children( $category_id, $taxonomy ),
            'operator' => 'NOT IN'
        ],
    ],
];