Why I'm getting variable not in scope error on every blueprint?

Add a printstring and breakpoint to the castFailed pin. I guess it can’t cast, so you will not get the output you expect? also add a breakpoint to your set node, there sould be the variable in scope when the debbuger halts.