Yes, you are right. Our brain needs a break when it has worked hard, we are not designed to work like machines without resting.
I can relate, I used to pull an all-nighter too when I was at school, because I would spend the whole day playing video games and make my homework at night, that was an habit, lol.
Luckily now I control my time using either pomodoro or just by calculating the time. I feel more productive and don't get bored this way. I would try the catnaps method, but I'm almost sure I will sleep straight to the next day, haha.
Lol my wife cannot cat nap... she would sleep through to the next day for sure!