I agree with all that's been said, too. My dd went through an awful stage at 2.5 where my champion sleeper who loved her bed was suddenly terrified. For me, the last thing I wanted was for the whole situation to escalate to the degree where she hated bedtime, her bed, and (like some other kids I had seen) started stressing out as soon as the bedtime routine started. I remember rocking her to sleep for a few nights, thinking it would be just a minor glitch, but my habitual girl got hooked on that fast.
I started sitting on the floor by her bed, holding her hand. Told her I could only stay if we were quiet. That got her past the really big fears.
When it was time to break that habit, I told her I had to go turn off a light somewhere, and I'd be right back. ALWAYS returning in under 30 seconds to build trust. After a week or so of that, I could use the potty (so like 2 minutes) and come right back. Then go get a drink, etc.
To this day (my dd is 8 yo) that "check" is still our norm. She can allow herself to relax in the knowledge that one of us will be back in for that last kiss in 5 or 10 minutes. At that "check", she usually askes for another check in 2 minutes, which we always do, but she is almost always asleep by then.
Not saying you need to have it become the habit we have made it...LOL....(we really don't mind, we just get ready for bed ourselves and then check in on her) but the re-building of trust has to happen in some way, and that is a great way to do it.
For now, to break the negative assosciation with bed/sleep, I'd stay very, very near and not tackle the "I'll be right back" for a while. And when you do, it is so important to keep it very, very brief....come back BEFORE she gets upset/scared. Even if you just pop into the hall to flick a light, just come back right away. It's about trust. Try to think of the long-term benefits of trust and her feeling safe in her bed, rather than the very temporary situation that you have right now. A little bit of work now will last forever in terms of peace and her feeling safe and trusting her enviornment.