It's not just you, I hear this often, but I am always suprised people can read for so long in bed. No matter how interesting a book is, I can rarely read more than 20-30 minutes before the urge to fall asleep becomes too strong.
Reading is usually more passive than coding. I'm often never sleepy if I'm actively coding something late at night but reading a book (no matter how engaging) or watching a tv show can very easily make me sleepy. That said, everyone's brains work very differently.
This is just so weird. In general coding won't let me fall asleep but a book 100% will never let me sleep until I finish.
I also find the idea of "forcing" yourself to read rather peculiar, but we're all different people. I wonder if there's genuinely something different in how the brain reacts.
This happens to me about once a year. I’m much more likely to stay up later than planned while doing other activities such as watching tv, coding, talking, social media, or spending time with my partner.