Ah so! Thank you! I would not have thought to stack up ".GetReference().GetBaseObject()" in a row like that. I learned a lot from this, including that you can do local variables in Papyrus fragments to avoid repetitive long strings.
Ironically, I think I'm going to remove this gear-swapping part and just have the player manually give the (non-quest-flagged) gear to the NPC, since the gear is found right next to an armoring bench, and if someone smiths it up they'll be frustrated that the transferred version loses the improvements. Plus it occurs to me that different follower frameworks handle follower-worn gear completely differently (put in inventory, put in special inventory, build outfit, etc.).
But I needed to learn this basic "get item away from player and into NPC inventory" process anyway, since I'll need it for a journal transfer later. So, thanks again. :-)