"Working 9 to 5" is an expression in America culture, rather than a "work day standard" that probably derives it current negative meaning with the movie titled "Nine to Five" / "9 to 5" and song of the same title released in 1980.
It is not intended to imply that a 40 hour work week and a "9 to 5" schedule are compatible, but more likely the "9 to 5" reference was a good moniker to describe "working a full time job" and worked well for the song and story line.
There are other cultural references that pre-date these but it seems to me this popularized the expression, along with the TV series that followed it (https://en.wikipedia.org/wiki/9_to_5_(TV_series)).
Your analysis of trying to figure in work breaks and legal matters is likely futile, but your general question is still a common question I've heard here in America with younger people entering the workforce.
EDIT: I am trying to address the phrase as a cultural expression versus this statement:
I encountered many times that a common way to work your hours (I suppose 8) a day is by working "9 to 5".
References to a "9 to 5" job should not be interpreted to mean that it is a common practice, as I have heard many people make reference to jobs they have in this way but the actual work hours are different. This makes it an "expression" more so than an "expectation" of a work day.
There are many similar expressions about jobs and work hours. I've heard "8 to 5" commonly expressing a "normal job" and other references to job hours with different implied meanings. For example having "banker's hours" implies a shorter work day because banks would open late/close early to perform accounting work, etc. although in recent years that has changed. The NY Stock Exchange opens at 9am and closes at 4pm but stock traders are notorious for working much longer hours; a "3rd shift" means late or unusual working hours.
A "9 to 5" position as a cultural expression seemed to be altered toward a negative connotation with the movie, song and TV series. If you read the plot of the movie, it creates an association with the phrase "9 to 5" as something undesirable and to be avoided, unlike "holding banker's hours" implies a job that is easy and undemanding or a day of "banker's hours" for a normal job being a short and easy day where one arrives late and/or leaves early.
The phrase is an expression, and I would not presume it to be a "common" work week for most employers. A vast majority of employers expect that employees are compensated for a 40 hour work week, expect meal breaks to not be considered a part of work hours, and "exempt" salaried employees are generally expected to approximately follow these same principles.