How to duplicate an object along with its parent/children relationships using Python in Blender 2.9x
I used to bpy.ops.object.duplicate to duplicate the selected objects coming from the select_set() method.
In this way, the underlying parent/children relationships are maintained during the duplication.