The syntax is right
library("survival")
library("survminer")
#> Loading required package: ggplot2
#> Loading required package: ggpubr
#> Loading required package: magrittr
lung %>% head(30) -> short_lung
fit <- coxph(Surv(time, status) ~sex + age, data = short_lung)
ggcoxdiagnostics(fit, type = "schoenfeld", ox.scale = "time")

Created on 2020-02-06 by the reprex package (v0.3.0)
So, it must be the rest of the data. Removing age works
library("survival")
library("survminer")
#> Loading required package: ggplot2
#> Loading required package: ggpubr
#> Loading required package: magrittr
lung %>% dplyr::select(time,status,sex,age) -> lung_trim
fit <- coxph(Surv(time, status) ~ sex, data = lung_trim)
ggcoxdiagnostics(fit, type = "schoenfeld", ox.scale = "time")

Created on 2020-02-06 by the reprex package (v0.3.0)
So, consider subsetting out age with NA