The only viable option here is to make yourself non-replaceable. Stuff as much knowledge in your head as possible, share bare minimum, use non-standard tech stack, write no documentation, ground as much project on yourself.
Several times in my career I've had my boss or one of my boss's peers send someone's resume to me because our tenures at another company lined up. Sometimes I knew them, and sometimes someone otherwise very well qualified for a job on the technical merits didn't get an initial interview because they were horrible to work with.
This will work only if your manager has 62 IQ.
they won’t let you make yourself irreplaceable