This is correct behaviour.
The rules say you cannot buy a card (or Event, etc.) if you have debt. That has been ruled to include buys from Black Market, so in your example the game correctly did not allow you to buy cards from the Black Market.
And unlike the buy phase, where you are allowed by the rules to repay debt, you cannot do so during your Action phase (where I assume you played Black Market). So unfortunately, even 1 debt will prevent you from buying anything from Black Market (in your Action phase).