I've spent a lot of time in Scandinavia and seen a lot of the old buildings. Yes, people seem to have been shorter back then, but maybe not by more than a couple inches on average. Also, people in general were shorter in previous centuries--or I should say, we're taller now, probably due to advances in nutrition in the West over the last century or so.
I spent four months in Korea back in 1988, and at 6'3" I was literally the tallest person in the country I saw during that time. But now there are a number of Korean young men who are that tall. The health and diet of the country has improved and made a difference.
BTW, one other reason for low doorways and ceilings in old buildings in northern climes could be in order to heat the house and keep the heat in.
Yes, the shortness certainly was due to diet.
It’s also an advantage when someone is coming in your house/building they have to duck their head.
Makes it a lot easier to cut it off if you don’t really want them in there.