The main function of HR is not to serve employees. The main function of HR is to protect the employer from legal liabilities.
Whole book is highly depressing, but very useful if you want to try to climb up the ladder.
This gets posted from time to time, but if you work for a company, you really owe it to yourself to read Corporate Confidential.
A few takeaways.
1. Performance improvement plans are not for performance improvement. They are for firing employees. Management already formed an irreversible negative view. It is too late.
2. You cannot win a case against the company. Because a) companies have more resources and b) even if you do win then other companies will mark you as a troublemaker. Getting hired is going to get a lot harder.
3. If you insist on fighting then do document everything. Supposedly you need a few months of notes. In other words, being called a slur once or twice does not make a hostile work environment. If HR is unaware then the company is not liable, but if you share your notes then you won't win the case anyway. There are a few narrow forms of discrimination that are claimable but the best option is to keep your head down and find a new job.
4. Do not document anything on company software or networks. My friend got to learn what Data Loss prevention software really did.
5. HR has zero legal obligation to keep your secrets. Their job is to identify threats to the company. They literally get paid to share your secrets.
Bonus anectode: I went to HR and asked "Are you legally required to keep things I tell you confidential? For example, if I tell you I want to leave then will you tell my boss?"
Her answer to my second question was no, but guess what my boss and I talked about the next day!