You have two issues:
First issue:
Your variable assignment does not work like you think it does:
FLAG="$PATH/$1_$3.flag" | tr -d \'
These are two commands separated by a pipe, meaning you send the output of the first command (the variable assignment) to the second command (tr). The second command will simply output the result. As the variable assignment has empty output, the output of tr is empty, too.
The variable assignment actually works, but as it is part of a pipe it runs in separate process and the main process including the commands afterwards (e.g. touch) can not access it.
Variable assignment including a command has to be done using command substitution:
FLAG="$(printf '%s' "$PATH/$1_$3.flag" | tr -d \')"
See also.
Second issue is that you overwrite your PATH variable:
PATH=/opt/omd/sites/icinga/var/TEST
FLAG="$PATH/$1_$3.flag" | tr -d \'
Now, tr will not work and give following error:
tr: command not found
I even get a nice additional information, but that might be bash or Ubuntu:
Command 'tr' is available in the following places
* /bin/tr
* /usr/bin/tr
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.
To fix this and also don't run into similar issues, follow the bash variable naming conventions:
path=/opt/omd/sites/icinga/var/TEST
flag="$(printf '%s' "$path/$1_$3.flag" | tr -d \')"