You didn't do anything wrong as far as Bairdotr's quest goes. Don't take her into the cave, or attack before the conversation gets triggered, and you can avoid her leaving.
I am pretty sure the answer is at least partly wrong. I entered the cave with her and left it with her after victory. That said - the dialogue in which she chose to stay with me referred to (a) dialogue(s) question(s) she had way back, answered by me consistently in one way.
Regards,
Thorsten