As many have stated previously, this is a logical error, I've posted on your original thread with the suitable fix for such an issue.
The brief period in between the animation actually is no animation, the animation value returns to -1, meaning the player is no longer animating. However just because the player is no longer animating, does not mean by any margin mean that the player is not actively interacting with an object or is not queued to interact with the object more.
I'd also recommend not sleeping your thread, that's lazy and bad practice for the solution you are looking to solve.