I don't really see the reason to preemptively lock communities in that manner, is there really much harm in letting them exist? I get consolidating communities that are literally clones of each other but none of your examples fall under that for me.
I personally wouldn't lock subs out of only inactivity at all. What if someone tries the Fediverse for the first time, sees that their niche sub exists and is faced with a "SUB LOCKED" message? Is that a better situation than them just seeing a long time having passed since last activity?