Explicitly setting object name to "X" actually sets it to "X.001"?
Blender uses the name to uniquely reference the object - so if an objects already exists with that name it cannot allow you to create another one. Instead, it creates the object and adds the ‘.001’ suffix to make it unique (or 002, 003, etc until it finds an unused name).

One solution to your problem is for your script to first check whether that object already exists and if it does to either rename or delete the old object before creating the new one - this way your object should always be created with the name you specify.