Walls are cheap. Depending on who you ask the HVAC is enough cheaper as to be worth it. (open offices are a nightmare to heat/cool: there are always temperature gradient across large rooms)
Walls and HVAC are cheap. What’s not cheap is all the additional square footage of floor plate to make offices work (additional space in the office itself, additional space for corridors, laying out architecture to allow sight lines to natural light, etc)