It looks like you have built the wall and then tried to add the door, but it appears just outside the wall. When you tell it to build, it may be giving an error because it is trying to build scaffolding and the door plan is in the way.
The door can be placed in a wrong place (not inside the wall) if you tried to use the Place Item tool from the bottom menu (P hotkey). This will not correctly place the door (and really shouldn’t be possible to try, but they haven’t gotten rid of it yet).
To place a door correctly, you should click on the image of the door in the custom building dialog, then click where you want to place it. Do not do this once you have ordered the hearthlings to build an object, as it will often cause errors or place the door on the outside of the wall instead.