This will probably sound funny but i really don’t even remember what the drama is about. All i know is that i think there were 2 male leads after the same girl. One is the main male lead who ended up getting the girl (ML1) and the other is the supporting male lead who did not get the girl (ML2). But then, they played together again in another drama (i couldn’t remember if it was just the 2 male lead or the female lead too). But this time, the role has switched, ML2 in the drama before, now plays the main male lead, and ML1 now is the supporting male lead.

I didn’t actually watched any of those 2 drama yet, i just saw like a clip of the newer drama on tiktok, and then saw the comments were talking about how in this universe it’s finally ML2 ‘s turn to get the girl that he didn’t get in the previous drama, like oh finally in this drama/universe he gets the girl.

The only thing I can think of is Kill Me, Heal Me and She Was Pretty but ML1 from Kill Me, Heal Me was not in She Was Pretty.

It's not exactly the same as you said but:

Wang Xing Yue failed to marry Bai Lu in Story of Kunning Palace but for upcoming drama Tang Gong Qi An Zhi Qing Wu Feng Ming they'll be paired.

Xu Kai failed to get Wu Jing Yan in Story of Yanxi Palace but he get her in Royal Feast

Zhang Ling He lost Yu Shu Xin in Love Between Fairy and Devil but he married to her in My Journey to You

As for MLs in the all first drama I mentioned: Zhang Ling He, Nie Yuan, and Wang He Di didn't appear in all 2nd drama I mentioned, sadly.