Earlier quoted context omitted.
IME this kind of experience comes when you have a manager who has no fundamental understanding of what it is that they are managing and has no particular reason to trust you. A manager who can monitor your output by reading your pull requests simply won't engage in this type of behavior whereas a manager who can't will usually instinctively gravitate to terrible metrics like "does he show dedication by being in at 9a…
Is turning up on time for your job a terrible metric? To me being on time is just a very basic low level requirement of being a professional. As the initial commenter said: trust goes both ways. Turning up on time is a good way to show your manager that you can be trusted. Edit: Actually, turning up on time may not make your manager trust you more, but turning up late will definitely make them trust you less.
A person who believes this would say that if according to policy my best employee should work 9am-5pm, but he prefers to work from 7am-3pm and is my best employee, it is the policy not the employee that needs changing.
Personally, I always try to get to the bottom of this stuff during job interviews - nobody wins if the employee assumes there will be flex-time and the company doesn't allow it!