Is there a workaround for the known bug in dynamic EnumProperty?
The Warning in the documentation states the EnumProperty should have a permanent handle on the items. One way I see, without resorting to a global variable, is to add an attribute to the getEnumStuff function. See relevant PEP 232. And then &quot;manually&quot; update the values before drawing the col.prop drawing call.
By the way, if you pass the context in a function, you should not use bpy.context afterwards but rather the context parameter because there could be a mismatch between the two, resulting in an incorrect context error.
import bpy


def getEnumStuff(context):
    getEnumStuff.enum_stuffs = [((obj.name, obj.name, &quot;&quot;)) for obj in context.selectable_objects]
getEnumStuff.enum_stuffs = []


class OBJECT_PT_example_panel(bpy.types.Panel):
    bl_category = &quot;Example&quot;
    bl_label = &quot;Example&quot;
    bl_space_type = &quot;VIEW_3D&quot;
    bl_region_type = &quot;UI&quot;
    bl_context = &quot;objectmode&quot;

    def draw(self, context):
        layout = self.layout
        col = layout.column()
        getEnumStuff(context) # Update enum items before drawing them
        col.prop(context.scene, &quot;stuff&quot;, expand = True)
        
        
classes = (
    OBJECT_PT_example_panel,)


def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.Scene.stuff = bpy.props.EnumProperty(
        name = &quot;stuff&quot;, 
        items = lambda self, context: getEnumStuff.enum_stuffs,
        description = &quot;&quot;)


def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)


if __name__ == &quot;__main__&quot;:
    register()

Result :