It worked in the end.
The problem was that when WeaponFire was executed, the AimTo task was finished, so the evaluation of InRanged was finished.
When AimTo is run on Tick, it will continue to evaluate, allowing the tree flow to work.
I think it was a rookie mistake. But I learned a lot from your reply. Thank you for your help!