He refuses to open the door for free, he doesn't refuse to unlock the door as a whole.
Person A isn't trapped indefinitely, he can get out, it only takes him a day of work. Maybe a scenario with a broken lock in a public restroom makes more sense. In that case a malfunction causes Person A to be trapped instead of another person.
Is person A really imprisoned though? He is able to get out within a day. Furthermore he was accidentally trapped, which is very unlikely I admit, by the host. The host doesn't prevent Person A from escaping his current situation. He does however refuse to service Person A for free. But you'll probably argue that the host is responsible for his actions even if it wasn't his intent. In that case it doesn't matter whether he was imprisoned or not since the host is still responsible for any disadvantage person A receives.
More interesting is a scenario in which person A traps himself or is trapped by a third party. Would that be a voluntary exchange if all other factors remain the same?
Or would the location need to change on neutral ground, let's say a public restroom with a broken lock, for it to be a voluntary exchange?
Or is something else making it involuntary?