Went through 6 rounds just to not get an offer

Looking for encouragement and positive stories. I received the rejection email a few days ago and still can’t shake off the negative or sad feelings.

The interview process was 1 month for a job that I really wanted and would’ve changed my life (fully remote and higher salary). I put in so much effort and time. I made it through the screening questions, writing sample, and group interview. Then they asked me to take 2 assessments. Once those looked good, I gave them my references who had to take a survey. Then I had to provide my legal name and address. I thought I got it at that point. I had a final round interview with the VP that went really well.

Every step went so well and I received great feedback. Friday morning I received an email that they extended the offer to another candidate, and they encouraged me to apply to other jobs they post. I wish I knew what the deciding factor was. I feel devastated. That was one of the most intense interviewing processes.