Using a diode-connected MOSFETs as a voltage divider
You're mixing up / combining small signal behavior and DC behavior.
The \$1/g_m\$ &quot;resistance&quot; of a MOSFET (it applies to JFETs and BJTs as well) is small signal behavior. So if you have a small signal (for example, a sinewave of 10 mV) at \$V_{in}\$ and
\$g_{m,M1}\$ = \$g_{m,M2}\$
then at \$V_{out}\$ you get a half of the input signal (so a sinewave of 5 mV).
If you change \$g_{m,M1}\$ and \$g_{m,M2}\$ you will indeed find that output voltage \$V_{out}\$will follow the resistive divider formula that you show.
However the behavior for DC voltages does not work in the same way. Then the formula \$I_D = \mu C_{OX}\frac W L (V_{GS} - V_{TH})\$ applies. If you would use two identical transistors and make \$V_{in}\$ = 5 V you would get \$V_{out}\$ = 2.5 V (I'm ignoring the body effect here!).
However, if you would make the bottom transistor M2 2 x larger (you could just put two identical MOSFETs in parallel) then you would not get \$V_{out}\$ = \$\frac 1 3\ V_{in}\$.
That is so because the threshold voltage \$V_{TH}\$ remains the same for M1 and (the double-size) M2. So although \$(V_{GS} - V_{TH})\$ of M2 will be half of the \$I_D = \mu C_{OX}\frac W L (V_{GS} - V_{TH})\$ of M1, this is not true for the threshold voltage \$V_{TH}\$.
Look at it this way, if we had transistors with a threshold voltage \$V_{TH}\$ = 0 (zero) then we would get:
\$V_{out}\$ = \$\frac 1 3\ V_{in}\$.
But the threshold voltage \$V_{TH}\$ is not zero so that &quot;messes up&quot; the voltage division ratio for DC voltages.