It is much easier to create the rounded corners in Illustrator, but I see what happens when you copy the shape from InDesign. It creates a Clipping group as you can see in the Layers panel. You can go: Object > Clipping Mask > Release, delete the resulting empty shape and fill the other with a gradient. Or you can select the <Clipping Path> in the Layers panel, delete it and fill the other object with a gradient.
... View more