The structure of interactions in most of animals and human societies can be best represented by complex hierarchical networks. In order to maintain close to optimal functioning both stability and adaptability are necessary. Here we investigate the stability of hierarchical networks that emerge from the simulations of an organization-type having an efficiency function reminiscent of the Hamiltonian of spin-glasses. Using this quantitative approach we find a number of expected (from everyday observations) and highly non-trivial results for the obtained locally optimal networks, including such as: i) stability increases with growing efficiency and level of hierarchy, ii) the same perturbation results in a larger change for more efficient states, iii) networks with a lower level of hierarchy become more efficient after perturbation, iv) due to the huge number of possible optimal states only a small fraction of them exhibits resilience and, finally, v) "attacks" targeting the nodes selectively (regarding their position in the hierarchy) can result in paradoxical outcomes.