Wa alaykum salam wa rahmatuLlahi wa barakatuHu,
Imam Shafi’i is clear that when an intention is made but nothing is expressed within the marriage contract to indicate to it being temporary, then it is a valid contract and she would thereby be lawful for her first husband to remarry. (Kitab al-Umm 5/85) If there is only an intention found, but nothing is stipulated in the contract, then it would be valid yet disliked even if they planned to marry for this purpose prior to effectuating the contract. (Tuhfat al-Muhtaj 7/312)
And Allah knows best.
Answered by Shaykh Yaqub Abdurrahman