Some travelers are bothered by walking through someone else’s room or having someone walk through theirs. That said, I have seen a few hostels that are set up this way.
The private room is still private as long as they are the only ones who have access, so it’s not necessarily such a big deal for them. The dorm ends up having additional people though, even if they’re just passing through. Perhaps you could give a slight discount for those dorm beds on account of the extra people passing through?
If you’re going to do it the way you described, make sure that it’s crystal clear how both rooms are set up before the guests book so that there won’t be any surprises when they arrive. Photographs will help more than words because people don’t tend to read property descriptions.
An alternative would be to describe both rooms together as one large dorm. For example, with 4 beds in each room, you can call it an 8-bed dorm and then (in theory) no one would be walking through someone else’s room. Of course in this case you would lose the option of a private room.
By the same theory, maybe you could call one room with 4 beds a 6-bed dorm, and two of the beds would be behind a locked door. You would only ever list availability for 4 beds, and you could sell the other two as a private. The only problem would be the ensuite bathroom, because if it’s a “6-bed” dorm, then the guests sleeping there may feel entitled to us the bathroom too.