@ninnynonny it was a bit harsh now I read it back but was meant from a good place I promise.
Sometimes the reality (the way I see your situation as a director of a business - I may be wrong) of a situation can be uncomfortable.
It's not you it's them is nice to hear but you mentioned that this hasn't been a one off. In that job, that's not to say all jobs will be like that - but where there is a pattern is often worth taking a step back from the hurt and emotions and looking at what part you may have played in it.
I'm sure you are a good, diligent employee with great skills for the job you do.
You've left because that was not enough - you want the next job up and repeatedly didn't get it.
Now sometimes that is because you didn't get it the first time someone was promoted over you and you were put in a "not senior mgt material but perfectly good at what they do"
box. A worker not a leader. And there you would stay - they hope you'll carry on as you are and not let your disappointment/disgruntlement show. But that's it. And if you are clearly posted off and resign - well that's fine - they can train someone else/muddle on/ implode (probably the first two in reality).
That's unfair! I know - but it's how companies operate. It wouldn't have changed at that company though so you have done the right thing by leaving.
So in many ways it's not about you. And in some ways it is about you.
Understanding the machinations of the business you work in, is, if you want to look at it that way a technical skill like any other.
It's not playing dirty/cheating to spend time working out how the organisations makes decisions and adapting your skills/ways of working to match that. It's clever.
It is, I can almost 100% guarantee, what the people who've been promoted have done consciously or otherwise.
So what I'm saying is technical skills and experience, reliability and admin are perhaps only 50% of the requirements for promotion. Sometimes even less.
That's seems mad/unfair to people who are good at their jobs and can't understand how "lesser" people get ahead of them.
On your behalf it really fucks me off that management don't make this really, really explicit to individuals and the organisation at large and mange people's expectations.
What happens is they lose valuable employees through making success and fulfilment only about promotion to management and not about relishing and valuing people with great technical skills and giving them advancement around that -Rather than expecting to become political animals and understand how to play the game.
So for your next job I'd have a good think about either finding a company where there is a line of progression through technical/doing roles as well as management.
Or if it's management you want then you are going to have to learn about and understand what skills you need to learn.
The most important of which is to the business you work for - what does good look like?
Ask them - actually ask them and keep asking them - what type of people progress to management roles, what skills do they have to display. Though it might be disheartening to learn that competence in current role is absolutely not top of the list.
Only you can know if you want to reassess yourself in light of that and perhaps change the way you operate.
Good luck!