I think it can only throw this error if the size required is larger than the maximum they have specified, since this branch is protected with a if (sizeRequired > sizeInternal).