What happens exactly, is that after duplicating an object, then deselecting all selected objects, using:
object is selected in red outline, not orange as usual, as a result, when editing object in edit mode, also in python, it doesn't work either
however, before running
bpy.ops.object.duplicate(), everything works properly.
I stumbled at this weird problem for a long while, i wonder how to fix it