The reported sample size does not match in 1p ratios if all denominator plot values equal to zero
The problem is in fn_1p1p_ratio_var where the actual sample size (n) is initiated by count(something) where something is the residual density which is NULL if the ratio is NULL (and this happens when all plots have just zero values in the denominator).