AnimationPlayer caches animated nodes. It may not notice if a node disappears, so clear_caches forces it to update the cache again.
See Implementation
AnimationPlayer caches animated nodes. It may not notice if a node disappears, so clear_caches forces it to update the cache again.