Raw, that's a hell no because the NPC didn't agree to be turned into a sword (and iirc, that's outside the scope of the spell anyway, no inanimate objects).
It's really not something that would work in a stable game setting.
That being said, it could still be allowed without being game breaking as long as the DM is willing to make the exception to the rules have a reason for happening. Say, the NPC had gained the attention of some entity that took the opportunity to intervene. Or maybe the NPC felt it coming, and decided to go along with it for nefarious purposes. There's all kinds of single event exceptions possible.
There's definitely a balance to be struck, and it depends on the table. I would only do this on a table where the rules are actually just guidelines.
For many others, a world needs to make sense internally. It doesn't need to make real-world sense, but within the world with its different reality, things kinda need to be consistent. For example, if it is easily possible for a wizard to circumvent your will save by asking a trick question, the whole world would look completely different. Almost everyone who interacts with any kind of wizard would be extremely guarded around giving consent for anything since it might just be a ploy to remove their resistances.
A resourceful/logical player would now try to trick an NPC into agreeing first, and well, if it doesn't work, you can still cast the spell normally, nothing lost. You could ask them to stop, or they could recognize themselves that doing it like that wouldn't be fun, but if you act in the world you usually always try to make the best decisions. If you artificially limit that in a fourth-wall-breaking way, the game actually starts to lose its appeal.
If you allow stuff like this all the time, eventually the alternate reality of your characters will just become a random clown show. Problem solving will just be about who comes up with the most ridiculous thing that makes everyone laugh about its absurdity. There will be no logic or rational thought involved anymore, it'll be no simulation anymore, just a sandbox. Which again, might be fine for certain tables, but many want to be able to immerse themselves in a different world that they can accept as at least possible, which is the actual fun for them.
So no, you aren't necessarily "not fun" if you don't allow this as a DM. You're just playing a different kind of game with a different kind of fun.
Almost everyone who interacts with any kind of wizard would be extremely guarded around giving consent for anything since it might just be a ploy to remove their resistances.
And that's totally fair and matches a lot of wizarding canon. It could very well be that this NPC isn't particularly bright, or at least not accustomed to dealing with wizards, but the DM can come up with some clever way to still have the story progress (i.e. the NPC happened to be wearing an amulet that protects them from magic, the NPC can communicate telepathically when transformed (so the story can continue), the magical power necessary knocks out the wizard and the spell link is broken, or the transmutation on an unwilling human is temporary and the wizard needs to roll X times above Y to maintain the spell (and X gets lower as the NPC submits).
There are a lot of ways to mitigate the impact of an outrageous player choice and discourage them from pulling further shenanigans. Just saying "no" is rarely the most fun option.