You can easily get stuck on a “good” salary in a bad job/company.
How do you know you are stuck?
You feel you are stuck.
You feel you accomplished everything in your current job/company.
You feel you learned all you can in your current job/company.
You rose too fast in the career ladder.
You feel you don't have more space to grow or to be promoted.
You feel your work is not valued.
You feel you are wasting your time.
You feel you are only working on legacy/old systems/projects.
You feel that you are not building anything new.
You feel your time is filled with bullshit meetings.
Problems with a “good” salary in a bad job/company
You reached your local maxima, and you need to get worse to be able to find your global maxima.
The first thing that you are going to do when you realize that you are stuck in a bad job/company is how hard it is to move to another job while earning the same as you are earning right now.
You don't fill the requisites of these job postings, your knowledge is not worth outside your current company. You were left behind.
The only solution is to accept earning less in the new field that you want to invest, so you can progress over your current situation.
Some people can't afford to earn less, so they get stuck in this trap.
How to avoid this trap?
To avoid this trap you should always avoid choosing a job based on the salary.
A good salary is good, but it should be the last part of your decision.
You should choose opportunities with high upsides and low downsides.
Joining an early-stage startup can have a lot of upsides if things go well, but it has very few downsides if things go wrong. At least you learned how to build a company from scratch and you reuse this knowledge to try again.
Your job opportunity should provide you space to grow, practice, experiment, and learn.
It also should give you many responsibilities so you have your skin in the game when taking your decisions.
Tips to exit the trap
Never stop learning
Work on side projects and open source to gain experience in new technology
Reduce your cost of living to save some money to be able to quit your current job and find a new one.
Get uncomfortable, if you are not feeling uncomfortable, your life is too easy and you are not learning enough