(#21947) Add missing error message for ILLEGAL_NAME

The faulty behavior was triggered by interpolation of an illegal name.
e.g. "Contains $CONTRABAND".
Merge pull request #1804 from hlindberg/issues/issue-21947

(#21947) Add missing error message for ILLEGAL_NAME