Yeah, there's entirely valid exceptions to the rule for sure, and this is definitely one of 'em.
> When I was younger I was taught that bikes weren’t allowed on the sidewalks, but to my surprise it’s actually been legally allowed in most cities where I’ve lived. There are a lot of wheeled and motorized types of traffic allowed on sidewalks in a lot of cities.
I've had police where I live ride up to me on their bikes, on the sidewalk to warn me that riding my bike on the sidewalk is illegal. Normally I'd just say "sorry" and stop doing the illegal thing, but in this case, they choose to consistently break the law themselves while telling others that activity is illegal, so I respond with "I'm willing to accept that, except why are you riding your bikes on the sidewalk?" - Police response: "Because it's not safe in the road here. Have you seen how drivers here drive?" - Me: "Point made. Thank you officer." - Police: "Okay, well, just be careful. Don't run into anyone on the sidewalk or we'll have to ticket you." - "Thanks officer. Y'all have a nice day." - Police: "You too." (Our police here are mostly pretty human and overall decent folk if you treat 'em as such. We're kinda lucky in that regard. I've been other places where that's absolutely not the case.)