HR does not protect you. They have two roles, and two roles only:
- They protect the company from being sued.
- They fire you.
- They protect the company from being sued.
- They fire you.
Anecdotally, I've also seen people complain of harassment when e.g. someone complemented them on their looks when wearing a bikini at a company event in Hawaii. So while I in general have no sympathy for HR, they do end up in such bullshit situations from time to time.
But yeah, 100% of their responsibility centers around protecting the company, and 0% around protecting the employee _per se_.