Safe shutdown circuitry for Raspberry Pi Zero with Adafruit TPL5111
You're mixing up distinct meanings of "shutdown".  

With something like the pi that can't ordinarily turn off its own power, what happens is that the the system should be rendered safe for power loss (file systems unmounted, storage devices de-initialized if possible, etc), and then the processor enters an end-state condition - either an infinite loop with interrupts disabled, or an actual halt condition.

What you need to do is get in right at that point, and drive the GPIO at the point where the processor is done with the safe system shutdown, and is in a non-returnable state.  At that point, it doesn't matter if the halt or infinite loop executes and the user pulls the power cable, or if the GPIO operation you add right before that last instruction instead removes the power, because you are inserting this instruction only at the point where power removal is already safe.

This would be kernel mode code, you might see if anything in /arch/arm/kernel/process.c seems to be the version in use, or if it is elsewhere.  GPIO on the pi is indirect, so you may need to do some work to figure out how to still accomplish that in an all-but-stopped system.