switch objects in the same position
I recommend you a free addon which I created, specifically for this situation:
Object Sequence (https://github.com/sacrish/Object-Sequence)
After installing the addon, first set up your scene with an hierarchy like this:

Basically put the objects which need to be switched in a separate collection (here I named it &quot;objects&quot;), meanwhile keep all other things like the table, camera, etc. in another collection.
Open Object Sequence panel from the &quot;Misc&quot; tab, select your collection of objects, and hit Sequentialize.

And you will notice in the timeline that the visibilities of the objects have been keyframed, with their object names labeled on corresponding frames.

Now hit Render Sequence in the Object Sequence panel, and the frames will be automatically rendered and saved. Save location is set in your Output panel, so make sure it's correct before hitting render.
I also have a Youtube video which demonstrates the workflow.