term_exists() returning NULL on term that exists

The third argument for term_exists() is an integer, not an array.

Parameters

$term
(integer|string) (required) The term
to check

Default: None
$taxonomy
(string) (optional) The taxonomy name to
use

Default: ”
$parent
(integer) (optional) $parent ID of parent
term under which to confine the exists search

Default: 0

Pass the correct arguments and it works.

var_dump(term_exists($name, $taxonomy_name)); 

0 is the default, so you don’t need to specify it.

tech