Hierarchical select hook form alter
Looks like $form['taxonomy'] is not an array.

There are some options for hierarchical selects maybe this is all you need:

http://localhost/admin/config/content/hierarchical_select