Last year in particular I made a few gambles as a moderator by establishing new policies on the local meta without first gathering community consensus. However, every time I found my policies gathering almost entirely upvotes, and eventually it was clear they were backed by the community. And, at least in one case, I did change some of the details of my approach based on community feedback.
I can't say I agree with every consensus on my sites, especially when so many predate even my presence, but I try to comply with them. For example, I'm honestly not a fan of ELL's restricted editing policy (showing restraint instead of fixing all the grammar mistakes in questions???). I follow it (at least for my definition of "makes the questions easier to understand"), and maybe one day I'll ask again if we really want that policy to see if the scales will tip more in my favor.
I've seen moderators on other sites go against their community's consensus, or insist on upholding a former consensus that has long lost its support (both of which are usually obvious due to the meta voting) or gamble like I did with policy but lose and I've also seen the price that was paid (and in many cases continues to be paid) as a result. I'm not convinced at all that it's worth it, but I'm also not sure if these mods can be compelled to change their minds, since they're usually enforcing policies that are either hotly debated or not entirely shunned across SE, ones that do have a consensus backing them on at least a few other sites.
Whenever I ask myself what policies I would enforce in opposition to my communities, my answers seem to fall flat. For example, I would still remove hateful comments even if my sites were filled with bigots...which could be seen as commendable, except that I learned moderators don't really have a choice because that's the Code of Conduct. I would also still spam-flag spam, but that's what's written in the Help Center. And being a moderator is fraught with one-off judgement calls on edge cases where there's some important factor that the original consensus didn't account for, or there are multiple, conflicting consensuses that could apply—in cases like these (assuming the situation can't be handled by the community) a moderator has little choice but to go against the consensus. But that shouldn't happen too often, and in at least some of those the community hopefully understands the circumstances.
Other than the obvious (i.e., non-negotiable SE-wide policy, or rare, unforeseen edge cases) when is it a good choice for a moderator to overrule their community? And when (and how) should moderators who go against community consensus be overruled themselves, especially considering the power difference?