It’s a popular joke among software engineers that writing overcomplicated, unmaintainable code is a pathway to job security. After all, if you’re the only person who can work on a system, they can’t fire you. There’s a related take that “nobody gets promoted for simplicity”: in other words, engineers who deliver overcomplicated crap will be promoted, because their work looks more impressive to non-technical managers.



Actually if you cannot be replaced, you’re less likely to be promoted. How could they move you from your crucial work. You also show leadership by upskilling and building a team that is stronger and independent. If you can do that in a small team, you can do that at a larger scale.
If a company operates different, they’re broken.
Don’t let insecurity push you to sacrifice your integrity, you’ll hate yourself more.