I have encountered this problem
I also had this problem and it was ended up being due to use of softwareserial to communicate with the bee at the same time as monitoring hardware serial via PC. Switching to using hardware pins 0/1 did the trick for me. See also code in this post:
Thank You!!! Been at this for 5 days now and found your code. Works like a charm.
I was about to throw the damn thing away and buy another bt card/shield.