When ILM is managing a following index, it will attempt to perform an unfollow action on the follower. It can be however that the unfollow action succeeds to make the index into a non-following index, yet the unfollow action completes with an error. This can occur if the follower was not able to remove the retention leases on its leader (e.g., a network connectivity issue). ILM on the following side should accept this possibility and not put the lifecycle into an error state. This can be determined when the unfollow action fails with an ElasticsearchException with the metadata es.failed_to_remove_retention_leases.
Relates #34648
Relates #39088