Moving the head/tail of a bone to the location of an empty

Hi all,

So my python coding abilities suck and AI is letting me down on what I thought would be a simple little coding test.

As the title says, using Python I’m trying to move (snap) the location of the head and tail of an armature bone to the location of two empties.

Now the code works, as long as the empties are NOT parented to a vertex inside of a mesh. When they are, then the head/tail just don’t move.

I’ve attached a test file which is in the setup that doesn’t work, ie the 4 empties are all parented to a different vertex within the mesh object. If you clear the parenting of each empties, it works, but I really need that parenting to be done.

Any ideas or is this even a possible bug?

gen_Rig_Reposition_test_v01.blend (1.0 MB)