Who should own the non player controlled replicated object?

Dumb question I know.

So imagine your player has a gun and the player character is the owner of the gun so it replicates and makes RPC call via that player.

Now player leaves server and drops the gun that others can pickup, but for clients that join after this its problematic as there is no owning connection through which Replication can be done. This is because when the player left the server the connection no longer exists.

So what should be done here?

Nobody would own it. It would be the same as any other actors that are replicated but now owned by players like a box of ammo for example. I think that the issue here is that the gun that you are leaving on the ground was previously owned by a player, if you want to avoid cleaning up this object you could just spawn a new gun that imitates the old gun (copy the values of ammo, damage, location, rotation, etc.), so to the player it looks like it’s the same gun but in reality is a completely different object that when you pick it up it gets destroyed but it gives the player the appropriate weapon.

Well your answer is on point, but I just realised that the question is invalid in the sense it does not need to be owned by anyone . Thanks for additional clarifications though.