Relocating HQ means laying off all your employees. This is not a figure of speech or analogy, it’s literally true. You are laying off all of your employees in the current location when you move the jobs away. The question is whether those employees are going to choose to uproot themselves to go work for you at the new HQ, or stay behind and find another job. Most will stay put instead of moving away. People generally don’t take kindly to forced moves. Many ethnic groups have legendary historical calamities that consist of being forced to move en masse.
If a software company did this, my guess is all development would cease for a long time and you may exceed the “bus factor” and permanently kill a large portion of projects. In fact I’m aware of management at one company winding down projects by moving the skeleton crew who agrees to leave to a lower COL city.
This is not much different from outsourcing to a lower COL country.