Physics not working as expected
You need to set the origin of the object to its center of mass else the simulation will become wonky. 
Select your object.

obj = bpy.data.objects['Cube']

obj.select_set(True)


While the object is selected in object mode, right click > Set Origin > To center of mass.

bpy.ops.object.origin_set(type='ORIGIN_CENTER_OF_VOLUME', center='MEDIAN')


Also, Apply scale with CTRL + A so that it is uniform at 1,1,1.

bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)


Check the difference here between one cube with its origin to its center of mass and one which is off-center. (the two origins of each cube are the yellow dots) :