It does happen, but generally in environments that are different from the 'normal' workplace - environments that contain a sense of community, where breakfast, lunch, and dinner, and sometimes evenings and sleeping are part of the job: grad school, hospitals, fieldwork, law/consulting/IB firms, etc. It seems like the mid-decade tech ideal was to import that kind of workplace style.
And you're right, that those hours are not all 'at the desk working', but they are still most definitely working hours when you're waiting for a page, an email, or a piece of data that require immediate response at 3am.
That kind of work can be deeply rewarding (in retrospect), but is very clearly damaging if it persists for too long.
I can say I've done a few 72 - 96 hour stretches of near total wakefulness (power naps of 20-40 minutes as possible, food and caffeine available nearly any time) but there's definitely a feeling of disconnect, being separate from the senses and just floating inside my own head toward the end of those.
We're talking full up tactical exercises in the military, and a couple of critical repair scenarios here and there since.
A couple of days of near total downtime is a minimum to reset from that kind of effort, and 'normal' work for at least a week or two if possible.
And you're right, that those hours are not all 'at the desk working', but they are still most definitely working hours when you're waiting for a page, an email, or a piece of data that require immediate response at 3am.
That kind of work can be deeply rewarding (in retrospect), but is very clearly damaging if it persists for too long.