I once did an even more extreme version of this. I showed up with a contract for a new job that would give me a 30% raise and an opportunity to work from home as much as I want. I told my boss to match that offer or I would sign it.
He took a few days to decide and made me an offer that was significantly worse, so now I have a new job, more money and haven’t seen the inside of a corporate office in months. My old team has been completely dissolved because the old crew left faster than they could train replacements.