Solution : select whole function and then run that (do not use ALT + F5)
In my case I am using ALT + F5 and in almost case it automatically select correct full query but not in this case so try to select that much query and then run, may be this work :)