Duplicate questions aren't necessarily bad. As you pointed out, it's entirely possible that people who did some research in the first example wouldn't have found the dupe target. Duplicates can be valuable as signposts, pointing people to a single place to get answers. (Fragmentation is bad, because it's hard to find all the solutions if they're all on different-but-the-same questions.)
As for your second example, I personally wouldn't have voted to close it; it looked to me like the tools are different. (But some people disagreed, evidently.) I did participate in the reopening of it though. Thanks for editing your question with additional information - that definitely helps get incorrect duplicate closures reversed, and I hope you continue to do such things.
Final note: no moderators were involved in the closure of your question. People who hold gold badges in the tag can perform unilateral duplicate closures and reopenings, as happened here. For more information, see the Meta Stack Exchange postthe Meta Stack Exchange post that created that ability.