Failing to scale a bone with individual origin?

Hi friends !
I’m creating a script for easing the rigging process and I’m facing a problem regarding the scaling of a bone. Specifically, I’m:

  1. Duplicating a bone, (in fact creating a new one and copying the transform of the target given that bpy.ops.armature.duplicate() did not work
  2. I want to scale the bone using INDIVIDUAL_ORIGINS so here’s my code:
def scale_bone(armature_name, bone_target, scale = 0.7): 
    bpy.context.scene.tool_settings.transform_pivot_point = 'INDIVIDUAL_ORIGINS'
    select_bone_from(armature_name, bone_target, True, True, True)
    bpy.ops.transform.resize(value = (scale, scale, scale))
    bpy.context.scene.tool_settings.transform_pivot_point = 'MEDIAN_POINT'

This code does indeed scale the bone, but I’m not getting the expected result. Instead, it seems to be scaling it MEDIAN_POINT style.

Anybody for a little bit of help ?
Thanks a lot !