When the last animation function call is run, anim.Finished will be set to true. The delta has still changed from the last call however so the height still needs to be set. The if check here prevented that and only caused problems. The function stops getting called on its own when the animation has nothing more to do.
Fixed DCollapsibleCategory animation sometimes not finishing