Component behaviour changes from main component to the instance

This is the right behaviour of the component created and it works fine when I open the preview for the first time.

When I collapse it and then open again it shows something like this. I’ll have to either restart or close the whole file and open again to check the behaviour.