Question about multiple h1b transfer

I have one question about the h1b transfer and wondering if team can help me here.

Currently, i am with company A and resigned.

Now i have received two offers from two different companies (X and Y). I want to join company Y but they are taking 2 months+ of time to initiate the transfer the visa but company X is willing to file to transfer in 2 weeks.

If both companies X and company Y apply for the h1b transfer (A ->X and A ->Y) and i join company X (once the X’s h1b visa transfer is approved\or in receipt in 2 weeks) while visa transfer from Y (A to company Y) is still in progress.

Now after 2+ months, once the visa from company Y is approved (A->Y), can i join the Y company at that time immediately , or do company Y need to transfer the visa again from X to Y as at that time I will be the part of company X.