Split from "A question to Sunni Brothers": Abu Bakr's khilafat and BB Ayesha

so When ALLAh kept Ibleees with him for so long and later on Iblees went against him does that Mean ALLAH made a mistake on the first place to keep iblees with him ? didnt ALLAH know Iblees is gona go againt ALLAH later on ?