Sorry but I somehow thought I had replied :-/
Indeed, the problem with original implementation and YieldReturn result in general, is that it is made so that the result condition (true/false) is held up and returned for one frame. As such, if within the same frame the agent is changed, it is not really taken into account.
Your solution of caching the agent is interesting and is possibly something that can be implemented in the base ConditionTask class itself so that it works for all inherited conditions.
I will take a look at this possibility once able.