Is that how it works? I thought if you are a staff writer you don't get individual ownership over characters. If you are freelance, contracted in, you do, because you don't have a continuing job.
Correct, and there's often a lot of confusion on this point, specifically as it relates to Locarno and Tom Paris.
If you are a full-time, regular, salaried member of the writing staff, then you don't have any claim to any specific characters and you get paid a pre-determined royalty rate.
If you are a freelancer and write an episode, and create a new character as part of that episode, then you still do not own the rights to the character -- Paramount does -- but you are entitled to royalties any time that character is used in another episode. So, for example, you couldn't stop Paramount from using the character nor could you go off and use them yourself in your own unrelated project. But if Paramount wants to use them, they have to pay up.
Naren Shankar, who co-wrote "The First Duty," was not a staff writer at the time of that episode, though he later became one. Therefore, had the Tom Paris character on Voyager been Locarno, Shankar would have been entitled to royalties for every episode Paris made an appearance in.
Michael Piller, on the other hand, was not only a staff writer, but an executive producer and the "showrunner" at the time of "The Best of Both Worlds." Not to mention that he was also a co-creator, executive producer, and showrunner on DS9. Therefore, his salary and royalties wouldn't have changed whether they used Shelby or not.