Pretty much this. I'm fortunate to work at a place where I'm paid to get a job done, and how/where/when I do that is largely up to my discretion because they treat me like the responsible adult I am.
If I occasionally work some nights or over a weekend? I might take a day or two off to avoid burnout (while making sure there is appropriate coverage in place). Likewise, if I need to have a contractor come over or something, I'll just work from home for that period of time. If I need to take care of personal things during the week where I can't work during that time, I just take care of it after hours or on the weekend as needed.
That said, I've worked at places with strict 9-5:30 (but really it is 6:30+ because of the workload) and they seem to want to have their cake and eat it too in terms of getting you in at a strict start time, get lots of extra hours + weekend time when needed, and then hit you with limited vacation time and pushback when you want to take a comp day. Sorry--doesn't work that way. Maybe when I was young and stupid, but at this point in my career I've lost all tolerance for that. Fortunately it seems many companies are starting to wise up and be fair about it.