I'm no expert on this, but I also read about this as I also tried calorie restriction.
You still have to keep your macros (and micros) in balance while on calorie deficit, which is even harder. Your body needs various things, you just need to optimize your food. Also, I think the main contributor for OPs issues was the fat deficit, which is very easy to fall into while you think you eat healthy a lean food. Fat is important for your hormone production.
https://m.youtube.com/watch?v=yQHFCpO6gHE