> The recruiter also said I was borderline, which might be just a nice empty word from her, but made me feel better.
I don't think this is just her being nice; I was also told I was borderline and they actually ended up letting me interview again for a different position (SETI instead of SWE). Alas I got rejected again, but the year after they called me back because I was borderline, or so they told me, and I am working there now.
As others have said, there is some element of chance, both on their part and also likely on yours. Hopefully you'll apply again as it seems like you have a good chance.