Can someone explain this type of rectangles?

I haven’t been able to figure out why this rectangle layer has 4 corners outside.

I think it’s related to the fact that the drop shadow is somehow detached. I mean, there’s an object between the rectangle and the drop shadow. How do you do this?

This icon means that the object is absolutely positioned. You can learn more in this Help Center article:

There may not even be a drop shadow here. It can be a simple object that is lower in the layer hierarchy. Just explore each layer and each of its properties.