It happened on purpose, so that, although it didn't look like God initially, it was Him from the beginning through to the end. Most are unaware that Jesus and satan had a discussion about one of His Apostles, whereby which when Peter had opened the door of access through sinning, Jesus simply gave satan permission to do his dirty work until such time that Jesus knew humility had now occupied what was once occupied by pride. Yup, act like you are all that and more than you might know will come a knockin' on your door. He is a subcontractor of Gods to test and to correct. See what up!