Why am I not able to use open overlay while hovering to connect variants of the same component?

I am trying to create an interactive component that can be reused across multiple Figma files. I want to be able to open a variant as an overlay while hovering but when I select “Open overlay”, it does not provide me with the option to select the variant as the overlay.
Please help me understand what is going wrong.

If you can’t select a variant as an overlay in Figma, ensure it’s part of a properly defined component set within the same file you’re working on. The variant must be visible, appropriately sized, and not nested too deeply. Double-check that your prototype interaction is set to Open overlay and correctly linked to the variant.