Non-Recursive get_term_children()

Presumably you want to output term data, so you can use get_terms with the child_of argument, then iterate over returned terms and check that the parent of each term is your main term id:

$parent_id = 42;
$children = get_terms( 'product_category', array( 'child_of' => $parent_id ) );

foreach( $children as $child ) {
    if( $parent_id == $child->parent )
        echo $child->name;
}

This will exclude grandchildren, as their parent term ID will be a child term, not your top level term.

error code: 523