The function was iterating over the legacy ID type. Use `bpy.data.grease_pencils_v3` instead.
str.format