I’m not a doctor or psychologist. I’m also aware that I’m replying to a greentext, but hear me out.
I think it’s simply “exercising agency and bodily autonomy.” Being able to modify one’s own body is a way to establish that you have the most basic form of control over yourself and your environment. It can help arrest the sensation of being out of control or under complete control of outside forces; an answer to feeling totally vulnerable. Cutting your hair off is an easy and quasi-socially-acceptable way to do this.
Were you not able to do this somehow, of your own volition, you’re probably in a very bad way and have much bigger problems to solve.