Insofar as tracking down the immediate error right now. If it's an invisible character (control code) that snuck into the $identifier call (as in $Forma#tString()) then hold down the SHIFT key while selecting the error message, and then paste the error message into the editbox or Notepad or elsewhere to examine it for control codes.
You can also perform a Ctrl+F search on the SHIFT-copied identifier name that contains invisible characters, and the editor should be able to find the bad instance.
If your FormatString alias is declared using "ALIAS -l" inside a remote script, then the identifier can only be used locally within that remote script. Remove the -l switch to allow it to work globally.