The key distinction is between wrongful restraint and wrongful confinement under the IPC.
\[\begin{array}{rl} \bullet & \text{**Wrongful Restraint (S. 339):** Obstructing a person's path in one direction while they are free to go in other directions. It is a partial restraint.} \\ \bullet & \text{**Wrongful Confinement (S. 340):** Restraining a person in a way that prevents them from moving beyond certain defined limits. It is a total restraint.} \\ \end{array}\]
In this case, by blocking all outlets of the building, 'A' has completely prevented 'Z' from proceeding in any direction beyond the confines of the building. This constitutes total restraint, which is wrongful confinement.