If I press "undo" when the Black Market buy interface is on, I am still getting a prompt to buy a card, but I don't see the card selection, so I am forced to click "Don't Buy". Technically, an undo request at that point (when playing black market but before buying a card) should be invalid, since new information has just been revealed.
As a workaround until this gets fixed, you can type /undo in the chat window, then click the place in the log that you want to return to.
Or you can request Undo several times until you are at the situation before playing the Black Market.
(This is faster with bots but less convenient for human opponents.)