Most programmers feel uncomfortable realizing that their employer may replace them one day. To make this event less likely to happen they do many things in order to make themselves unreplaceable. One of those things is unmaintainable source code, which nobody else will be able to understand if its author is fired. I think that this mindset is not only toxic but also very typical for unprofessional engineers. If you are professional enough, the market always has something to offer you and you always know what is the next step for you, after this team gets rid of you or you decide to quit. If you feel scared, just look into the future and start checking opportunities.
The video is here: https://youtu.be/yRm97umW4vE