I must say, I believe sin is always a failure. Not on God of course, but a failure on Man's part. I do not believe sin is or was apart of God's plans. I believe God knew sin was going to be present and planned for it by activating the promise and principle of causing all things to work for our good (Rom 8:28) Just as He did with Joseph and the evil his brothers done to him (Gen 50:20), He also does with Israel and with any other situation in which we fail. So God used the failure to plan the redemption of the failure, but in my opinion He did not plan the failure. But we both know this is a deeper issue of how we see God's sovereignty, and I'd rather not get into that topic. It never goes well lol
Best of luck to you.