bmesh - extrude face and end up with closed mesh
You don't need to duplicate the geometry prior to extruding (this will remove the need for removing doubles as well), and using bmesh.ops.extrude_face_region is what you're looking for to generate a closed mesh from the extruded face/s.



This worked code fine with a 1-face plane with its sole face selected in edit mode:

import bpy, bmesh
from mathutils import Vector

bm      = bmesh.from_edit_mesh( bpy.context.object.data )
newGeom = bmesh.ops.extrude_face_region( bm, geom = bm.faces, use_select_history = True )

bmesh.ops.translate( bm, vec = Vector((0,0,1)), verts = bm.select_history[0].verts )

bmesh.update_edit_mesh( bpy.context.object.data )