When you trying to insert child categories you are looking for term_exists() to return an array with a key term_id.
Following the documentation for term_exists
Return Values
(mixed)
- Returns 0 or NULL if the term does not exist.
- Returns the term ID if no taxonomy was specified and the term exists.
- Returns an array if the parent exists. (format: array(‘term_id’=>term id, ‘term_taxonomy_id’=>taxonomy id))
It seems that you are missing the third argument for term_exists() and this is the ID of the previously inserted category which will be parent.
Hope that helps!