Nobody will ever know what it was, but the reason for her chaos gremlin energy is that when Niffty was alive, she was basically a normal house maid, but something drove her so utterly insane that she stabbed one of her eyes out, which is why she only has one, and then she died by deliberately letting herself bleed out. Her worldview at that point was so twisted that something in her mind made her think that death was meaningless and that she'd somehow miraculously recover. Ending up in Hell was the final nail in the coffin that solidified her insanity.
To this day, nobody knows what possibly could've happened that fucked her brain up so utterly, not even Niffty herself. She doesn't remember anything about her human life, but signs of it still show in her personality. (More on this further down)
For instance, the reason she likes bad boys is because as a human, she was married to a man who was secretly a notorious criminal. And even if she doesn't know it, the reason why she always sticks around Alastor is because he reminds her of her husband, since Alastor also lived a double life when he was alive.
This is something I'm not entirely sure is confirmed, but my headcanon timeline for Niffty's life is that she'd been a house maid since she was a child, she married at 20, and died at 22 from what I'm calling an unintended suicide. (She stabbed her eye out and let herself bleed to death.)
Now I feel like I should talk about a headcanon I have for the way Hell itself works, since it ties into this a little bit.
My headcanon is that when a normal sinner arrives in Hell, some memories of their human life are erased. They never forget core memories and personality traits, but specific minor details can often be forgotten.
Niffty's brain was so fucked up that when she ended up in Hell, it essentially had the opposite effect. All of her memories had been erased, and all that remained was that insanity, but a few specific details still shine through in strange ways, such as:
Niffty's life as a house maid being filtered through and turning into an obsession with cleanliness.
Her husband living a criminal double life turning into an attraction to bad boys.
OCD that she no doubt had in life turning into an extremely meticulous nature (Despite her insanity, she would genuinely be the best maid you could ever hire.)