Hi Astilius. I'm really sorry about this. You must feel quite hurt. I think the one good thing is that they admitted that you are invaluable. And I want to stress that if you are enjoying what you do, be careful to think it may be great to be promoted: if you get into a position where people report to you, it is essentially a social type role which can put enormous pressure on us. But, if you can do it, yes, then it is very unfair that you were overlooked. I am truly sorry.
I hope you can forgive them for their ignorance and continue being the valuable person you are.