TLDR: Whether it makes sense depends on your moral code and world view. There is an alternative: an exit interview.
In general this is something that cannot be universally answered as to whether it reaps a net benefit or not. The single action of filing a complaint is probably not to your personal benefit:
- it will be effort
- come with some risk if the company tries to avert any blame and tries to redirect the issue towards you by discrediting yourself
- you might not get as positive a reference letter depending on who writes it; BUT you might also get a slightly better reference letter depending on who writes it and what their moral view is
- you might not as easily be able to come back to the same company, BUT it might also be easier to come back and be a better environment by then
most of these points are depending on how the handling of the complaint goes, whether the manager you will complain about is a single bad apple or whether the whole company / management level is rotten. Whether your colleagues share your view or not etc.
So it is a mixed bag. Looking at it like that, the cost-benefit ratio is rather murky. It would look better if you would still consider to stay if the manager got demoted, removed or improved their behaviour because then a) there would be more motivation for HR to rectify the situation especially if it looks like you are the main person bothered by the manager's behaviour (if you're gone, less reason to change something) and b) the personal cost of having to work under the same conditions would likely easily outweigh the potential cost and risk associated with handing in a complaint.
However, there is another view to take that I feel is often overlooked here and that is the social aspect. Because there is another cost and benefit calculation that has to do with how the world should work ideally. How would it benefit other people like you, people who do things right? If your colleagues suffer under the same problems as you then your action can make things better for them too. The same goes for your replacement that is going to be hired. It could be your contribution to make the world or at least the workplace a more just place. Ideally we all contribute to a good working environment and this can be a step in that direction. If no one ever speaks up about injustices they are not gonna go away and not everyone can just "run away" to a different job.
If you adopt that mindset then the cost-benefit trade-off is different, but it must still be you who decides what personal risk and effort you accept to contribute. You also should be sure that your point of view is shared by your colleagues and you are not just having a personal chemistry problem with your manager. Before going to a strong move like involving HR you should be sure that you have addressed the issue personally with your manager and given them a chance to rectify their behaviour as they are also a participant in the workplace and might just have no idea how hurtful their behaviour is.
Now, an official HR complaint is a strong move that can have strong effects either for the manager or you and certainly will induce some level of stress to both of you and everyone else involved. You should consider how egregious the problematic behaviour is and how much you think it affects an average person that works with the accused to judge whether it's worth to fight it personally.
An alternative to reduce the risks and necessary effort/stress level would be to mention the colleague's behaviour perhaps even in semi-anonymous form in an exit interview. The benefit is that it has less direct effects, a limited amount of time investment and as long as you don't slander people with strong but unprovable accusations of serious misconduct typically also has a limited risk to backfire. It also has a lower chance of having strong effects, but it may still help. If there are more and more such exit interviews HR might investigate on their own or at least give soft recommendations to the manager or their superior. Similarly, if one of your colleagues in the future makes a complaint with HR it can help as context to support their cause, it's immediately not the first time HR hear about bad behaviour from that manager which can help a lot to turn it from "that one weirdo in the team that has issues with a tougher management style" to an issue that seems to have a broader effect and be constant over time.
Also note that either way, how effective any action you do is depends how open the other side is to you and how willing to rock the boat, what the general company culture is, how well connected the accused and yourself are and how broad support for your and your cause will be (e.g. will most team members and HR members agree that the actions of the manager are problematic or not)