Actually, the latest info suggest that the SW 'thought' the lander was underground at one point. This could have been seen as a red flag that the data were wrong for that input at least.
Of course, this is easy to say now, who would have thought to add the code to say "If the data say we are underground, disregard it".
Never-the-less, info like "After this elapsed time, we ought to be about this high, anything outside a certain range must be wrong, guess a height". Guessing would probably result in a similar outcome though.
It can be hard to get even a small amount of code right in all circumstances.