UProperty Components showing up oddly in the details panel

I don’t know if its something I do wrong, but my UProperty components I create in C++ always show up weird in the details panels. I don’t know how best to explain it, so here’s a picture!

Oddly enough, my camera component doesn’t have the same problem - it already shows up like the panel on the right. Just the scene component does this in this instance, though I often get this problem with any components added in C++.

What can I do so that when I select my component, it looks like the panel on the right, not the one in the middle of the image?

Credit to u/boterock on the subreddit

Dont set components as EditAnywhere, set them as VisibleAnywhere or VisibleDefaultsOnly instead.
When you set a component as EditAnywhere you are meaning that the pointer should be set to other things, VisibleAnywhere means “this points to this component. the pointer cannot change, but the component properties can”.

This is only for Components, other UObject types you should set them with the EditAnywhere or EditDefaultsOnly flag.