So close!
(Also, under very different circumstances obviously but Darren Stewart and Bartosz Fabiński fought in Cage Warriors during covid whilst still with UFC and went back after)
UFC has used development contracts where they let a fighter compete elsewhere before making a full move to UFC, but I'm not sure if I've ever heard of another case where UFC lets a fighter go back and forth between different orgs.