To address the specific example, first of all these parties seem unlikely to nominate the same candidate, but I know it's an intentionally extreme example. If someone is anti-gun and still wants to vote Mamdani, then voting for him on Party D would give the pro-gun party more access to funding, and there are surely other races on the ballot where parties A and D have different candidates.
I see where you're coming from in the sense that a vote for him under Party D is in part a statement that you like him but disagree with his gun stance, and it's hard to gauge whether or how much a politician might take that "statement" under consideration, but I don't think that is the (or even a) primary driver behind fusion voting. I don't have different expectations when voting for someone under Working Families as opposed to Democrat, for example.