Another answer gives the correct workaround.
What is the cause of the problem ...
This is a compile time error.
If the link refers to a non-existent compilation of the object, it is delayed until it is executed, but ultimately the entire statement must be compiled into the execution plan before it is executed.
This fails if the table does not exist, and the execution of this statement does not even begin.
(the execution plan that he is trying to create using the passthru predicate to avoid evaluating the state if CASE has not met)

In a workaround, the SELECT vs. testtable moves to another statement. Compiling this statement is still delayed, and since the statement is never executed, everything is working fine.
source share