Commiserations. I've been on the other side of having to tell people that they were appointable but that they didn't get the job.
Sometimes it is just not possible to pin down the exact reason, in that all appointable applicants were, well, appointable (do not underestimate hgat this means, it's actually important), but that one candidate fulfilled the required criteria more fully, or had the balance of types of research for that post in that department. Or that there is demonstrated capacity to do a particular kind of teaching in a specific area (in my Department that can be critical). And so on. There is usually only one job, so only one appointment can be made.
I know it's frustrating. If there were something tangible that you were lacking and that you could fix, then that might feel more helpful. Sometimes, it's not that you're not right; just that another candidate was righter for that job, at that time, in that department.
When I was hunting for my first job, single, with a mortgage, so I really really needed a job, I really had to earn, the future was a bit frightening as it was in a recession ... anyway, I was gutted not to even be interviewed for one particular job for which I was very well qualified. But thank goodness I didn't get that job! The person who did got stuck, and I did other things and zoomed up. Still, as a professor, I've not gotten a couple of jobs I'd rather liked to have.