get_categories returns top-level categories instead of child categories

I believe what you’re seeing is the expected behavior when parent is set to 0 which is what get_cat_id() returns if it fails to find a category ID for the $cat_name argument. You can quickly test this by putting var_dump($current_cat_id); anytime after you set it to see if this guess is right. If so, you’ll need to figure out why you’re not getting a $current_cat_id.

The way you’re doing it right now strikes me as fairly error-prone though it’s hard to know without more context. I’d look to get the ID directly from a get_the_terms() if you’re on single posts or maybe with get_query_var() if on a term archive page.

Tangentially, your code shouldn’t be working at all if what you pasted is unedited since your if statement has no test to perform.