When dealing with a fixed point in time, it's what is witnessed that is important.
The events of Lake Silencio were the fixed point, who was there, what they saw, and what the end result was. The Death of the Doctor is not the fixed point in time. Everyone witnessing the Death of the Doctor and believing he was dead was.
So when River Song refuses to shoot, it doesn't matter that it's not the Doctor in front of her, nor does it matter that it's not the Doctor she's touching later. As far as anyone knows, it's the Doctor, and it's her target regardless, and that's enough to fulfill the conditions.
The trope is common enough when dealing with time travel, in plots where paradoxes are possible. This is in fact the same strategy that he uses later...
... during The Day of the Doctor, when re-entering the events of the end of the Time War, where Gallifrey and the Daleks were supposed to have all been destroyed and does actually appear that way, and what actually happens is quite different
In fact, as pointed out in the comment linking the similar question, the currently top-voted and accepted answer mentions proof that the Doctor never could have been dying when we saw him at Lake Silencio...
... because The Time of the Doctor shows that his regenerations are actually completely exhausted, as both the War Doctor and Ten's Hybrid counted as full regenerations that weren't acknowledged as such. Eleven never could have started regenerating at all, so it was always an illusion in play (even if the writers couldn't have known that at the time, it fits quite nicely in retrospect).