Error when creating taxonomy term programmatically
i found the solution.

the problem was with uppercase/lowercase vid value.

If your vocabulary starts with an uppercase letter ex: 'Animal', thr vid value will starts with a lowercase letter ex: 'animal' otherwise you will have an error

This was my problem, hope it will you help.