There's got to be more to this story.. People don't just screw people over like that. I'm not accusing you of being a bad worker, but i've worked with people in the lab and my spouse has too, and there are some people that can just be ridiculously annoying. They are messy, they don't do work, they don't learn well (ie dont take notes and then constantly ask the same questions over and over, and take their nice manager for granted), show up late, leave early, disrupt others in the lab because they're always looking online at youtube videos etc. And just play stupid immature practical jokes all day. If this sounds like you, think about it. I"m not saying it happened, but some people are kind of oblivious to the fact that they're being disruptive. Also, leaving for three months probably left a real sour spot on your PI. Now i'm not criticizing you, just bringing up something i've noticed first-hand in the lab. Just saying.. there's more to this story.
Regardless, if your PI didn't think she could write a positive letter of recommendation, then in good conscious should have told you that and not offered to write a negative one.