It is believed that the marriage that will make her permissible for her first husband must be a valid marriage. Temporary marriage (Mut’ah marriage) or marriage for the purpose of making her permissible for first husband (Tahleel marriage) are harams and invalid. i.e. one cannot marry a woman temporarily with an intention to divorce her and make her permissible for her first husband is haram and invalid. Such marriages don’t make a woman permissible for her first husband. Majority of scholars are of same belief and say so.
Allah (SWT) mentioned in surah AR-RUM that from amongst the signs of Allah (SWT) i.e. which indicates the greatness, grandeur, and majesty of Allah, signs which are indicative of the oneness of Allah (SWT). Amongst those signs is that he has created from you “mates” so that you may find rest in her and he has made between you love and mercy indeed this (marriage) is a sign for those who think.