I'm happy to be at work at 9am on the dot, if my boss is happy for me to leave at 5pm on the dot, and not read any email or slack until 9am next morning. In my experience it is basically impossible in modern tech jobs to do that.
Seriously. Some companies want it both ways- constant access via email/slack/on call rotations, but a strict clock-out time of 5pm? "You aren't a team player."
So, so much this. I am really sick of the double-faced bullshit nature of companies extolling their work-life balance and then going nuclear when anyone exercises it. At some of my jobs it really didn't matter how much work you did during the commute or at home - no, what actually mattered was are you at your desk after 7pm showing your "dedication". You could've been literally watching /dev/random on your screen but it counted.
It's a tragedy of the commons, isn't it? If everyone left at 5PM, I'd be pretty tempted to stay till 6, for a chance to bond with management and get promotions faster.