I have had similar experiences, though not as bad as what you describe. Firstly, I think the vacation is a great idea, as it will give you some perspective and time to re-evaluate both the outcome and your future options. Having said that, it’s probably best, if you can, to take off for at least a few days (perhaps go and see some friends or family in another city?) so you’re not just mooching around the house feeling hard done by.
I can’t speak for your exact situation, of course, but it seems to me the reason given for their choice was a decent one - the fact the issue did not come up at interview is unfortunate, but if it was really that close a call (and there is no reason to believe it wasn’t), perhaps it’s not a central part of the role. If I were you, I would take strength from the fact that they clearly felt you were a very good fit for the role, and it was just unfortunate someone came along with slightly better qualifications.
In my experiences of this sort of thing, the first time I was invited to apply for a job only to be told there had been a freeze on recruitment in that area, so the job was no longer available. This annoyed me as clearance should have been given for this before the position was advertised. The positives I took from that were that I was quite pleased not to be working for someone that incompetent, and I think their reason was genuine as they haven’t recruited anyone else in the year or two since then - so I think it was a genuine mistake. At the time I had my suspicions that it was just an excuse not to employ me as they didn’t think I was right for it.
The second time, 9 people were interviewed for 2 positions (so my odds were worse than yours to begin with). I was told that 8 of these (including me) were good enough to do the job, so it was a very close call. When I asked for the reason that I wasn’t chosen, the reason I was given seemed a bit spurious, but again, on reflection if it was that close then I was just unlucky that there were so many good candidates, so they picked up on that one point and used it as an excuse. The people who did get the job are indeed highly competent and I bear them no grudges.
I am quite pleased with the way things have turned out as I am fortunate enough to still be happy in my current job - but then I am very easy-going. It also helps that I don’t work with the people who snubbed me on a daily basis. But when I do see them in the office I am as friendly towards them as if nothing had happened. My advice would be not to burn your bridges, swallow your pride, and carry on doing a a great job - you never know, perhaps the new person will be a terrible fit for the company and/or leave in 6 months, you will then be in a very strong position to re-apply.
The above makes it sound easy and of course it isn’t, but I hope some of it helps.