It's accidental. The problem with fentanyl is that it's so ridiculously strong.
So you're selling heroin and figure "hey, I'll cut it and make more money". You add something inert and then add a tiny bit of a fentanyl and oops you added too much, now it's poisonous for users to take a "normal" dose.