I can’t test this right now, so I can’t say this for sure, but it appears to me that the Hearthlings might not have enough room to place the upper half of the walls. If you dig up 2 or 3 blocks, that should hopefully work. (By digging up, I mean digging down from the surface to a point where the pit merges with your tunnel, because Hearthlings can’t move up My point is that you need more space.)
If they can mine 4 blocks tall with no climbing/scaffolding then why not build 4 blocks tall with no climbing/scaffolding? guess i have to do it some other way then.
It could also be that they don’t reach the 3 corners which are “locked” behind surrounding blocks.
Not sure though; I’ve never tried to build something with walls that are directly surrounded by other walls.