Auto layout in the component does not work

Autolayout stops working if you make a component out of it.

A component consists of two other components.
Clicking on the internal option should reveal the partition details.
This works if these two components are combined by auto layout, and the main container changes its height as needed. But if they are combined into one component with auto layout, then the height of the container does not work correctly when clicked.

Link to the file and video of the error I add
Figma - https://www.figma.com/design/dGSxWR5NvlCE6FXsoIku6T/Auto-layout-bag?node-id=0-1&t=kIiVUF5wjfOHtfph-1

Video - Monosnap

Give me a hint if there’s something wrong with the way it’s done.
Thank you.