Analog Filter Prototype to Direct Form Second Order Cascade
The coefficients in the function lowpass3() are the numerator and denominator coefficients of the two sections (first and second order) of the normalized continuous-time transfer function. The continuous-time transfer function looks like this:

$$H(s)=\frac{b_{21}s^2+b_{11}s+b_{01}}{s^2+a_{11}s+a_{01}}\cdot\frac{1}{s+a_{02}}\tag{1}$$

Note that this normalized filter has  a cut-off frequency of $1$. The two functions tf2s and tf1s transform these two sections to the discrete-time domain using the bilinear transform, whereby the normalized cut-off frequency of the continuous-time filter is mapped to the desired cut-off frequency in the discrete-time domain. So whereas the coefficients in $(1)$ are independent of the cut-off frequency (because the filter is normalized), the coefficients of both final filter sections in the discrete-time domain do depend on the cut-off frequency.

Your example of using ncauer followed by zp2sos will not give you the coefficients of the discrete-time filter with the desired cut-off frequency. Instead, you just the compute the coefficients of the first and second order sections of the normalized continuous-time low pass filter, i.e., the coefficients hard-coded in lowpass3(). What you miss in that case is the transformation step from continuous-time to discrete-time, and the mapping of the normalized cut-off frequency to the desired cut-off frequency.