Copy Custom Property and set it as a suffix of an object's name
Try this
import bpy
for ob in [*bpy.data.objects]:
    if not ob.select_get(): continue
    if &quot;id&quot; not in ob: continue
    suf = &quot;?id=%s&quot; % ob[&quot;id&quot;]
    ob.name += suf