Which is "Nie mogę spać po kawie". Which is of course a more natural sentence, but that's not what the Polish one says.
Why is "I don't sleep after drinking coffee" wrong when "...after having coffee" isn't?
If 'having' was accepted, then 'drinking' should be as well, I think. Added.
But 'having' shouldn'e be accepted as well, no? The sentence is not 'Nie śpię po piciu kawie'?