max_fcnt_gap nor maxfcntgap yields any results on the Chirpstack repository, so then I tried gap which led me straight to
With a bit of inference and a clarification on wrapping_sub() and wrapping_add(), it is clear that the gap has a max value of (1 << 16) which is added to the FCnt value.