If the light is amber, not red, it means the parcel shelf is in the up position, so no room for the roof to fit.
Turn the knobs to lower it.
If it is down then it’s the microswitch on the front wall of the boot (trunk).
If you opened it a little way then it would work to close as there is nothing impeding it in that direction.