Contrast this with Crypt, for example, which does prevent debt from being gained. Trickster says "when you discard a Treasure from play ..." and takes effect at Clean-Up. Crypt takes effect before Clean-Up, during your Night phase. So, when Clean-Up begins, those cards are no longer present to be discarded
If Trickster had said something like "at the end of your Buy phase, you may set aside a Treasure card in play that you would discard ..." then it would prevent the debt from being gained because it wouldn't be present to be discarded at Clean-Up (in practice such a hypothetical variant would rarely differ in effect from the actual version - Capital's the only exception I can think of)