I've had this happen multiple times. Why would you hire your own replacement? (This is how they think.)
When they have someone hiring not based on what's best for the company but what's best for their own career goals, you know you're going to have issues.
Welcome to the world of tailoring yourself for the job. I'm in my 40s, so it gets worse. Can't wait until I'm over 50!