It's a bit confusing due to the nature of thinking.
If I was thinking something and it turned out to be false: I have been thinking that I'm getting sufficient sleep, but it turns out I wasn't. Or should it be had since I just thought that I'm not getting sufficient sleep? I had been thinking that I was getting sufficient sleep, but it turns out I wasn't.
What if I realized a few hours before the conversation that I wasn't getting sufficient sleep?
I feel that "I have been thinking a lot, so my head hurts" is better off with have been.
Also, "I have/had been thinking of calling you" seems to be fine with both.
If we take a different example, I think if you were running for a few hours and are now walking, should you say I have been running..? But if you were doing sprints everyday and decided to jog today, I had been doing sprints... is better?