I’m not sure about the reason of that issue but this is not a correct use of automation toggle as it won’t restore latest state. That toggling feature implemented before we’ve implemented ticket states but I’m keeping it for backward compatibility.
Instead you can create two buttons and display one of them as Gift Receipt state changes. Same as we’ve implemented Gift and Cancel Gift buttons.