I'm not sure what you're trying to do, but I noticed that there's a rounding issue.
x1 <- c(668, rep(NA, 6), 1852)
x2 <- zoo::na.fill(x1, "extend")
res <- round(x2 - dplyr::lag(x2, default = 0), 0)
sum(res, na.rm = TRUE)
#> [1] 1851
max(x1, na.rm = TRUE)
#> [1] 1852
sum(res, na.rm = TRUE) == max(x1, na.rm = TRUE)
#> [1] FALSE
Created on 2021-03-07 by the reprex package (v1.0.0)