There are pressure sensors that do have a few cm height resolution, for example, Honeywell makes this differential pressure sensor:
https://www.digikey.com/product-detail/ ... ND/3935154
its claimed *accuracy* is 0.25% full scale of 2.5 mbar, meaning 6.25 microbar or 625 mPa. At sea level & 15 C, that pressure change would be caused by a 5 cm elevation change. The resolution might be considerably better, depending on how long you wait to average the noise in readings.
Of course, a pressure sensor used as an altimeter is obviously affected by the weather- ambient barometric pressure is always changing, plus in practice there is always noise from wind, doors opening/closing, etc. which affects pressure readings at the few-cm level of sensitivity.
It is difficult to get cm-level height resolution from consumer-level GPS. For what it's worth, there are now $30 laser time-of-flight distance meters that have millimeter resolution over many 10s of meters. I have a Suaoki S9 and it does work as described. https://www.amazon.com/gp/product/B018FWF7X4