I saw this on 20/20 (or one of those shows) a few years ago and it was pretty scary. I'm sorry you are going through this!
I don't think that your protein intake has anything to do with this. Most people eat too much protein. It's my understanding that the charts are not accurate for overweight and obese individuals. There are far too many variables to consider to make them accurate.
Since this seems to happen only when you diet, you might be able to solve it by making sure you go to bed feeling satisfied and not hungry. Save some of your calories for a bedtime snack, and something that leaves you full (ish). Make sure all of your food is in the cabinets or fridge. Place some tape on the cabinets and fridge so you can check in the morning to see if you've been in there. It might work! And it might not, lol. I'm glad you are going to a therapist, s/he'll be able to help.
You might also purge your home of snack food, such as the Ritz crackers. See if you make a bee-line for the carrot sticks