The issue that I have with this type of article and why they never resonate with me is that they seem to assume you’ll be able to find a job with a similar salary if not a higher one, by snapping your fingers. I’ll tell you my experience: I’ve been working for 21 years, and I’ve only worked for two companies in that time period (there was a short stint at a third one, but I didn’t fully quit one of the other two so I…
They all knew that they had to leave because they were feeling miserable but they didn't because they were scared of not being able to find a job elsewhere. What didn't help was that management threw just enough money at those who're perceived to be performing well and made it even harder for them to leave.
Eventually layoffs happened. Almost all of them ended up finding better work conditions and substantially higher salaries elsewhere except for the most senior ones who have been around for a long time. The problem with the very senior (staff +) engineers is mostly only a salary problem because (relatively) they have been too loyal and don't have the track record to convince people that they are worth as much as they claim they do. The problem is that the longer you stay, the more this is a problem -- so if you see somewhere that you can take a small pay cut to get the opportunity to grow and be happier and have more room to grow, you probably should start trying now.
I can't comment much about your situations but at least in my country engineers are relatively well-paid -- yet people still hesitate to leave because of family, or mortgage or... whatever reasons they can come up with. Those are usually just excuses in my opinion -- nobody is asking you to ditch everything today without a plan. There is certainly a chance that you can get a job elsewhere and end up not passing probation, but that's up for you to gauge.
At the end of the day there is really nothing stopping you from trying except for yourself and irrational thoughts. Staying at the same job for too long is a risk in itself, it doesn't stop them from giving you a month of notice now and you'll be gone next month -- it doesn't matter if you're hardworking or if you think you know some parts of the system better than anyone. No matter how hard you try, emotions do leak slowly over time even if you're very careful to not show them, so be careful about that too.
It may sound harsh but if it has been going on for a long time and you are not willing to take (calculated) risks and make small, temporary sacrifice for a potentially better future, you are basically just victimizing yourself.
Start by applying for jobs and interview. If you think this management will likely get rid of you because of AI then that's more reason to go somewhere else that may value you more. Nobody knows how well AI will get compared to any of us, but if you're worried now then do something about it: expand your skill set horizontally, actually look for other opportunities regularly, _connect_ with people so that you're not just a number on a payroll, etc.
I wish you all the best and find meaning and hope in what you do soon!