I used to work at such place. The "office hours" were 9-6 and people were expected to adhere to that. I was an architect on a project and engaged in highly creative work so I tried to make my hours slightly more flexible, because honestly, my output was very high and I didn't think it mattered whether I was there 9-6, 10-7 or whatever. Soon enough I got called into a meeting with the company president and an HR person and was sternly told that if I didn't start showing up at 9am straight that I would be let go. I tried to argue that the hours don't really matter for creative work and was told "Don't try to make this company into something it's not".
Some places are completely fucked up and beyond toxic. It also just so happens they're run by idiots.
In fact, one place where I don't see this attitude at all is a place that does enforce a strict 9-6 schedule. It's more than 40 hours a week, but they're extremely rigid about it - no laptops go home, and working outside of those hours is more or less prohibited.
Because in my experience, for most software centric companies it's just a paper obligation which is ignored with mutual agreement as long as the job gets done.
In fact, I don't know of anybody still forced to work 9-to-5 without a contextual reason (opening hours, shifts etc).