When removing Tasks that are not visible (the parent task is collapsed) an ArgumentOutOfRangeException is thrown.