Can you ignore your own death flags and spare a character if you changed your mind? I am wondering if ignoring a bunch of death flags you set up for killing a character can backfire if you change your mind as you're about to kill him in the story. Is this a violation of the Chekhov's gun? I am wondering if there's a purpose in ignoring your own death flags just to tell your readers, gotcha. Is it a bad idea, or is it often done and thus is completely fine?
Depending on what kind of story you write it could work as a "teachable" moment. Having a character face her or his own mortality can be part of their character growth, the death flags you set up might have gone ignored by the characters themselves but they might see them coming from now on.
Additionally, not dying is not the same as going unscathed, you could replace their deaths with physical wounds or mental trauma and have them deal with it.
And lastly other characters could be effected by it becoming more protective of the character, changing their relationship dynamics.
It's not a cop-out if it serves a purpose to the story, but if you ignore it completely it will feel cheap.
This is what Russell T Davies did in the 2006 Doctor Who 2-parter Army of Ghosts/Doomsday. In fact, his version was even more extreme: Rose, narrating the opening to both episodes, explicitly described their events as the day she died. But it turns out what really happens is she goes missing, then is presumed to be among many who died that day.
Does it work well? Actually, yes it does. Rose was prepared to risk her life to stay with the Doctor, but is still separated from him, much to their mutual chagrin. The viewer is so prepared for her death they're unprepared for, hence all the more vulnerable to, an even worse fate: her having to live without him.
Having said that, I doubt Davies planned to kill her, changed his mind at the last minute, then wrote around death flags because it would be harder to take them out. I think he did something more well-advised: edit in flags such as foreshadowing later.