It was and is not God's desire for men to perish. It was his desire to show His grace to mankind, but how could He unless mankind first needed a Savior.
https://gotquestions.org/predestinat...knowledge.html
The truth is that the word foreknew in Romans 8:29 is not speaking of God's knowing the future. The word foreknowledge is never used in terms of knowing about future events, times or actions (God’s omniscience). What it does describe is a predetermined relationship in the knowledge of God whereby God brings the salvation relationship into existence by decreeing it into existence ahead of time.