Edit: Spleling
During a game of Star Wars d6 rpg i ran a group through basically the train job episode of firefly (that was in solo 12 years later) and they did not realize it until we were watching firefly together. I also ran them through the cloud city plot from ESB while they were on cloud city.
That’s what I mean though. If they are even somewhat aware of the characters you are borrowing from, they’ll know the NPCs are rip-offs, regardless of a name swap. I feel like you would have to do more than just change their name. Perhaps combining characters to make 1, or modifying character traits so they’re not 1:1.
I suppose it also depends on whether or not your players care about that sort of thing though, and if you as the DM don’t come clean about your shenanigans when caught.
I think the prior reply explained it best though. You’re not literally copying and pasting a fictional character into your world and just changing their name. You’re using good characters from fiction and copying their tropes into your world. Because those tropes work and they exist for a reason.
In any work of fiction, including building a TTRPG world, it is assumed you will be borrowing inspiration from other sources. I can’t imagine having to try to come up with 100% unique characters and ideas to run for my players. I’ve had lots of instances too where I come up with something I think is original and a player asks “oh wait, is this inspired by X?”
Point of the ramble being: everything has been thought of to some degree—it’s how the applications are used in your world that make them unique. Plus when we encounter a character that reminds us of an existing really good one, I think it makes it easier/more comfortable to get into a good RP mood with them. And even more fun when you do subversions of their existing character.