From the documentation of etoolbox:
\ifdef{<control sequence>}{<true>}{<false>}
Expands to <true> if the <control sequence> is defined, and to <false> otherwise. Note that control sequences will be considered as defined even if their meaning is \relax. This command is a LaTeX wrapper for the e-TeX primitive \ifdefined.
\ifundef{<control sequence>}{<true>}{<false>}
Expands to <true> if the <control sequence> is undefined, and to <false> otherwise. Apart from reversing the logic of the test, this command also differs from \ifdef in that commands will be considered as undefined if their meaning is \relax.
\ifcsdef{<csname>}{<true>}{<false>}
Similar to \ifdef except that it takes a control sequence name as its first
argument. This command is a LaTeX wrapper for the e-TeX primitive \ifcsname.
\ifcsundef{<csname>}{<true>}{<false>}
Similar to \ifundef except that it takes a control sequence name as its first argument. This command may be used as a drop-in replacement for the \@ifundefined test in the LaTeX kernel.
Thus you should use \ifcsundef (reversing the two arguments):
\ifcsundef{chapter}{chapter is NOT defined}{chapter is defined}
or
\ifundef\chapter{chapter is NOT defined}{chapter is defined}
The titlesec package performs the test \@ifundefined{chapter}{...}{...} and so \chapter becomes equivalent to \relax.