get_terms($taxonomy, array('parent' => $parent));
This works for some parents and returns an empty array for others. I checked if a term with the parent ID exists and if the same ID is in the 'parent' field of the child term's taxonomy. Even copy-pasted directly from the database. Is there anything else? I don't see a difference between the parents that work and the ones that don't.
edit: All invisible terms appear the moment I add a new term via the dashboard. Turns out the problem was that there is a function
wp_insert_term() for adding terms and I was using
$wpdb->insert and manually inserting the term and the taxonomy, which makes a difference, somehow.