A string (or even a "fail") is not a condition you can use in "if". If you
want to check if the lookup succeeded you have to use a condition, e.g.
"eq":
${if eq {${lookup ...{1}{0}}} {1}}
"condition" in an ACL only expects something like 1, 0, yes or no. You can
rewrite it like that: