The possibility of sin was certainly in God’s plan. The inevitability of the consequences is likewise.
Of course, God planned for the possibility of sin. But that doesn’t mean that was part of the plan, but a deviation from His plan. Gods original plan was for no sin and no Islam. That was The Plan.