Linking between diff variants and a modal within the same frame/art board

Hi there.

I’ve got stuck while prototyping as I want to connect two variants of a component with a frame in a way that Variant A links to the frame (it’s a modal that opens as an overlay), and the frame links (back) to Variant B.

Variant A (empty table) → Modal (overlay) with a single select list (selecting an item closes the modal) → Variant B (Filled table)

Have anyone had a chance to face such an obstacle? I must admit it’s a really hard nut to crack. These items (the variants and the frame) are part of a bigger flow, as presented in the sketch below.

I thought about making the whole section a component with variants: empty table and filled table. However, showing the modal as an overlay is still a problem as it can’t be displayed within the prototype artboard but rather within the variant artboard.

Another solution is creating another frame with variant B, which would complicate the source file architecture.

I hope I spelled my thoughts out clearly enough.