i need help finishing this addon

I don’t know much about coding i kinda understand the very basics so i am using chatgpt and other AIs to help me make it but i got stuck and the AI is just giving me the same code without any difference so basically i am trying to make an addon that takes the selected 3d model and takes each part and laies it out inside a mesh that i input the dimensions of basically like maxcut (i cant use max cut because it doesnt use weird shapes and i want it tin blender) so right now i cant get the xyz input field to work and there is this error “Python: Traceback (most recent call last): line 31, in execute
TypeError: bpy_struct: item.attr = val: expected sequence items of type float, not _PropertyDeferred” that i cant get the AI to fix
here is what i have so far i just need tips and explanations on how to fix and do things right

import bpy
import mathutils  # Use mathutils for Blender math functions


class MyAddonSettings(bpy.types.PropertyGroup):
    """Stores dimensions for the addon"""
    dimensions_x = bpy.props.FloatProperty(name="Dimension X", default=1.0)
    dimensions_y = bpy.props.FloatProperty(name="Dimension Y", default=1.0)
    dimensions_z = bpy.props.FloatProperty(name="Dimension Z", default=1.0)


class CopyPasteFlatOperator(bpy.types.Operator):
    """Copy and Paste Flat Operator"""
    bl_idname = "object.copy_paste_flat"  # Unique identifier
    bl_label = "Copy Paste Flat"  # Label displayed in the menu

    def execute(self, context):
        # Get the selected meshes
        selected_meshes = bpy.context.selected_objects

        # Create a new empty collection to store the copies
        new_collection = bpy.data.collections.new("Copied Meshes")
        bpy.context.scene.collection.children.link(new_collection)

        # Create a new mesh with specified dimensions (from panel properties)
        container_mesh = bpy.data.meshes.new(name="Container Mesh")
        container_mesh.from_pydata(coords=[], edges=[], faces=[])  # Empty mesh data
        container_object = bpy.data.objects.new(
            name="Container", object_data=container_mesh
        )
        bpy.context.collection.objects.link(container_object)

        container_object.scale = (
            context.scene.my_addon.dimensions_x,
            context.scene.my_addon.dimensions_y,
            context.scene.my_addon.dimensions_z,
        )

        # Copy and paste each mesh, adjusting its location within the new mesh
        for mesh in selected_meshes:
            mesh_copy = mesh.copy()
            mesh_copy.data = mesh.data.copy()

            # Link the copy to the new collection
            new_collection.objects.link(mesh_copy)

            # Adjust location to be flat and centered within the container mesh
            mesh_copy.location = container_object.location + (
                context.scene.my_addon.dimensions_x / 2,
                context.scene.my_addon.dimensions_y / 2,
                context.scene.my_addon.dimensions_z / 2,
            )

            # Ensure copied mesh stays within container boundaries (basic approach)
            max_x, max_y, max_z = (
                context.scene.my_addon.dimensions_x,
                context.scene.my_addon.dimensions_y,
                context.scene.my_addon.dimensions_z,
            )
            min_x, min_y, min_z = -max_x, -max_y, -max_z
            mesh_copy.scale = (
                min(1.0, max_x / mesh_copy.dimensions.x),
                min(1.0, max_y / mesh_copy.dimensions.y),
                min(1.0, max_z / mesh_copy.dimensions.z),
            )

        return {'FINISHED'}  # Indicate successful execution


class LayoutDemoPanel(bpy.types.Panel):
    """Creates a Panel in the scene context of the properties editor"""
    bl_label = "Blender addon"
    bl_idname = "SCENE_PT_layout"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"

    # Define the properties for dimensions
    @classmethod
    def get_settings(cls):
        return bpy.context.scene.my_addon

    def draw(self, context):
        layout = self.layout
        settings = self.get_settings()

        # Add input fields for dimensions (using FloatProperty)
        layout.prop(settings, "dimensions_x")
        layout.prop(settings, "dimensions_y")
        layout.prop(settings, "dimensions_z")

        # Big button to trigger operator
        layout.label(text="Create Mesh and Paste Copies:")
        row = layout.row()
        row.scale_y = 3.0
        row.operator("object.copy_paste_flat")


def register():
    # Ensure LayoutDemoPanel is registered before Scene
    bpy.utils.register_class(MyAddonSettings)  # Register the property group first
    bpy.utils.register_class(LayoutDemoPanel)
    bpy.utils.register_class(CopyPasteFlatOperator)

    # Now register the property in the Scene
    bpy.types.Scene.my_addon = bpy.props.PointerProperty(type=MyAddonSettings)


def unregister():
    del bpy.types.Scene.my_addon
    bpy.utils.unregister_class(CopyPasteFlatOperator)
    bpy.utils.unregister_class(LayoutDemoPanel)
    bpy.utils.unregister_class(MyAddonSettings)


if __name__ == "__main__":
    register()