Why a failed handler gets its payment back and a failed settlement does not
A payment gate marks a payment spent before it knows whether the work succeeded. You don't get to pick that ordering: record the key after the handler returns and the entire run is open to a second presentation of the same signed payload.