He is the Rock, his works are perfect, and all his ways are just. A faithful God who does no wrong, upright and just is he. Deuteronomy 32:4
Can God still call himself perfect if he created a human race that turned to sin and had to be flooded out of existence? Mankind has failed greatly. Does that mean God is to blame?
God did not fail since he created people with freewill. Not giving people freewill and forcing them to love him would be a failure of his own freewill. It was the perfect decision with possible consequences.
However, by making that perfect choice to give us freewill, God opened up his creation to failure. But was Henry Ford a failure for making a car that ultimately kills thousands and thousands of people? What people do with the invention speaks of their own failure, not the failure of the manufacturer.
God posts warnings and instructions so there is no failure, but people choose to ignore them. The Bible is the manufacturer's guide to how to operate life perfectly.
Despite our arrogance, God graciously steps in and "fixes" the failure of his perfect creation by making it right again. The blood of Christ completely washes away the imperfection by paying for the failure and making it new. In the end, heaven is a perfect place where no more failure will ever occur forever.
It's the perfect solution to bring perfection to a creation that chose to fail.