It has happened multiple times for me: Someone in the company refers me or I apply for a job, technical interview goes very well and technical team/person seems very interested and excited. Then a HR person contacts me or interviews me, she/he looks not interested from the beginning and has socially and professionally unacceptable behavior (generally I have high tolerance and regardless of the situation I try to be professional especially with people who I don't know). Eventually I don't hear back from her, she rejects me or I just walk away even if there is still a chance to continue.
I always assume a bad HR means a bad company and don't mind that it didn't work. Is my assumption true? If no, what's your advice?