Hi,
Which version of
CMS do you use?
How are you changing the ID of the web part? I tried it and the Id is correctly changed for given document in the DocumentContent column (CMS_Document table) also for already existing documents. Could you please check it too?
More details about your code and about how to reproduce this issue would be much appreciated.
Best regards,
Juraj Ondrus