It does seem like mismanagement to me. Certainly there are some exceptions, but relying on layoffs to manage costs isn't free and depending on how it's done just violates the "treat people they way you would want to be treated" principal. That's not free, enough of it changes culture, and workers will adjust how they behave in a cut-throat environment. It will cost companies eventually in various dings to productivity.
I don't know about HashiCorp in particular, but usually, there's enough metrics for a company to see that they are headed into an overstaffing situation and work to correct that without layoffs. A true hiring freeze combined with natural attrition rates goes a long way. It varies, but a 5-15% for attrition is pretty common. And you can offer incentives for early departure to bump that up.
Also, depending on industry, there are other levers to reduce cost or boost margins that you could pull before resorting to layoffs. Including both labor and non-labor levers. Layoffs often feel like the lazy path.