This sound familiar to me as I was like this as a child- I used to be vile to my poor mum- told her how i couldn't possibly be her daughter as she was soooo EVIL! ( all she was trying to do was get me to go to bed). Your daughter is probably so scared of herself and her own emotions and really doesn't have a clue why she is like this.
For me, the best thing ( and the worst) was when my mum went out and let my dad put me to bed- I hated it when he put me to bed as he wouldnt give me any lee way. but it was a lot less stressful for all, as he would just repeat BED to me over and over and i would stand there threatening to do all sorts of things ( smash my room up, pull my hair out etc etc) and he would just repeat BED to me... not having an audience and thinking my dad really didn't care made me feel a bit ridiculous and there was no point to my shenanigans, so i didn't bother. ( he actually did care and love me, but was just smart enough and not so emotional to allow things to escalate)
My mum would allow me to get involved into conversation and would answer me back when I started making threats, or slamming doors or cover the mirror with toothpaste?!!!
I now know, that the fact I was so out of control of my emotions ( for no particular reason- i had a very loving and firm and fair upbringing)was made worse by me KNOWING that I could get some reaction out of my mum- ANY attention for me was better than none at all and although i hated it, i loved it! I also knew that ultimately I held a lot of power over my mum and would really tug at the heart strings.
I think it might be worth you trying to expain to DD that when you put her to bed, if she chooses to come down and behave badly, then you are not interested- and from the point of putting her to bed- try to ignore and swallow back any retorts/threats/pleading As she goes wailing around the house like a banshee- as long as she and any other children are safe- let her get on with it- for as long as it takes- she can't stay in heightened anger and upset ALL night- ( maybe a few hours) eventually she might realise what a twit she is being ( i did, and felt ashamed and awful) and go to sleep and maybe go to sleep with no cuddles!!!
Discussions about what has happened should happen in the morning, she can talk about her fears and anxieties in the morning, punishments and consequences can be issued in the morning. Expainations of what you expect of her can happen pre- bedtime. But NOT after you have come down stairs. Although it may seem strange- negative attention for a child like this is certainly better than none- it sounds like she had had a good amount of control over to you- for a 9 year old to dictate where you should be when she goes to sleep is not right- and for some children having control is too overwhelming and thats when it all goes wrong.
Good luck! I hope maybe some of this info helps. How does your husband handle it?