BWHAHAHAHAHAHA! <sniff> Ah, you youngsters ... I needed a good laugh.
HR works for the company. Their goal is to keep the company out of legal hot water. Any other goal is secondary--solving employee problems doesn't even register.
Should he have stuck it out? Yeah, probably, but there are some bosses that are beyond unacceptable--and the boss was likely to shaft him on a review if he is that bad.
Yes, he should have talked to the contracting company before doing this. That way they would have known to steer their folks clear of that asshole boss--and they could have probably gotten his contract reassigned.