An interesting question.
I am currently designing a set of nightstands. I didn't compare the heights to my mattress, but mostly just what felt right for me. And what feels right for me likely was developed from having the same nightstands for the past 30+ years.
On this nightstand, I would say 28" would be the primary height. The open space below that will be filled by a stereo receiver on this nightstand, and on the other nighstand I will add a drawer there.
If I were reaching over for the volume control on that receiver, probably a little below the mattress height is going to feel best, and really, that is about the only thing I might be reaching for while in bed.
On the other nightstand a clock will be on the 28" platform. Small speakers and assorted junk on the 36.5" platform.
And then at one point, I will likely make a new bed, and all these relative heights will be out the window.
View attachment 839751