Oh Sanpet, I am so sorry this happened to you. Let me share with you two stories from different sides.
Many, many moons ago I was in a similar position. Worked countless hours, weekends, went above and beyond and they by pure chance found out they were bringing in someone at a higher level pay. I was so upset. The other execs told main boss that this was wrong but he had made up his mind. I left a month later and went to work in a temp position which eventually turned into a permanent job at the best company I've ever work for. Three months later I got a call from the main boss at the first company asking me if I would be interested in coming back. I decline his offer.
On a different note, I was hired at my current job at a higher level than the existing three admins. I believe at least one of them was interested in the position and got passed over. At first I thought it was awful for her but after a while I think we both understood it would not have been a good fit for her. The job is very analytical and I am under a lot of pressure constantly. She doesn't work well under these conditions. She stresses out just as an onlooker

. Ultimately she was happy she got passed over and after a while she found another position at the same company she is much happier in.
Good luck with what ever you decide to do.
