So this is a thing, I now have a prison. XD
Bug: “Doughnut Hole Buildings” trap workers.
Suggestion: Don’t place scaffolding in doorways, or allow doors to be placed first as scaffolding. Other option, double sided scaffolding for houses so that people don’t get trapped inside. Another suggestion yet, allow scaffolding to be used as ladders, although this would cease working once the wall got above 2 blocks height from the floor.
Personally I think the easiest thing and most elegant looking in the game would be not to have scaffolding in doorways if possible.