\chardef token is not a character, but a command to print a character.
As such, it is not allowed inside
\csname...\endcsname where only character tokens (after macro expansion) are permitted.
The fact that
~ is because a
\chardef token is unexpandable. Similarly for
The fact that TeX assigns special internal codes to active characters is irrelevant. The relevant aspect is whether an active character's definition is a macro or not. If it is a macro, it is expanded; otherwise it isn't and it's behavior depends on the context.
So, for instance, if you have
\csname\ifnum~="16 \string~\else foo\fi\endcsname
is perfectly good and would end up with
\~. But it's not really "using
\csname...\endcsname, of course.
On the other hand,
\& is defined by
\& is not allowed ”naked” inside
\csname...\endcsname, exactly like
~ would be if it's a
Another similar problem is with implicit character tokens. If you do
you're not allowed to use
\csname...\endcsname as well.