I only have USA marina experience. Some have a "checkout" time in late morning. I've never heard midnight-to-midnight, no. I do know a couple public marinas that will let you tie up and stay all day while you run errands but if you stay "overnight" (assume midnight) they charge you. Similar to your story, there's a marina (Channel Islands Marina or something near Ventura in SoCal) that a friend, who came into the marina, was at the pumpout or visitor's dock trying to figure out where to go. He was chatted up by the security guy...talk, talk, talk, talk 30 minutes of talking. My friend thought it was nuts until after midnight (they showed up at 11:30 pm). Security didn't explain it, but at midnight he said--lets go up and get you checked in and THEN when they were going to the office, he says "oh, you'd have had to pay for an extra day if you came in before midnight." so he saved them the $$$.
It really doesn't matter if only that one marina has the rule, they're setting their own pricing and rules and can do so. If you left before midnight and the port police saw you leave (um, gotta gps track showing time-stamp?) then it seems you're in the clear unless the rule is that you must checkout with the office during office hours.
Before we go into a marina, we assure that our checkout will be "ok" even if unsupervised. For example, we recently departed a marina after closing hours on a Monday evening but the marina office is closed until Thursday morning. We verified that all would be fine before departure. They told us where to put the keys for safe keeping and off we went.
What you describe is one of those crazy situations which lead us to simply "avoid" a marina with any sort of weird policy. It'll get you always. Sad to say, easy for us to complain, but even easier to just avoid such marinas.