I would say that Peter was still being refined and the words of Satan came through Peter at that time. Just as Jesus addressed demons inside a person, Jesus was speaking to Satan inside Peter. Though for Peter it was not his core being. n
This is a example of the gift of the Holy Spirit called distinguishing between the spirits in the NT.