Keep getting mixed signals on job search

I'm a strategy/operations/analytics person with 5+ years of experience. I've been job searching for a few months and continue to have one of two things happen:1. During an interview a hiring manager or decision maker affirmatively says they very much enjoyed our chat and are going to recommend I move forward...only to get rejected later over email before that next step gets scheduled. This has happened at least 5 times. I'm confused whether that means people are generally very two-faced and not saying the truth, which would be awfully sad, or whether they're so frequently changing their minds after talking to me? 2. I end up rejected for a job but the hiring manager liked me so much that they refer me to a friend at another company or a different role at their company, but not the one I originally wanted. It's usually a less interesting role or company. I'm lucky to be in a spot where I really want my next move to be the right thing for me and not just the first thing I can find.Am I going for the wrong roles? Doing something wrong? I'm confused because I'm getting positive feedback during interviews, but then not getting the job. I always ask for feedback once rejected and almost never get it. Has this ever happened to anyone else? Bad luck or a me-problem?