At what point did you want to play the Gatekeeper?
After the Grotto discard+draw was over? That worked for me on a relaod test. If you tried at that time and it didn't work, this is indeed a bug.
Or did you want to play it after the War Chest (which gained you a Duchy)? That would be to late, as you are then in your Buy phase already, so you can't play an Action card, even haven't used up any Actions in that turn.