Imam al-Shafi'i (may Allah have mercy on him) says concerning this verse: When their term is close to completion, then take them back in a good manner or leave them so that their iddah is completed; and He has forbidden retaining them with the intention of causing harm, so no one should retain them for that purpose.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الرجعة / 15154