Peter was not directly rebuked....remember what the voice of the Father said “this is my beloved son, LISTEN to HIM!”
Here the Father was clearly announcing that Christ’s authority was above yet in fullfillment of the laws of the prophets. Peter was speaking in reverential awe and humility, despite his ignorance. God was simply clarifying the lines of spiritual authority starting from himself, then thru the Son Jesus Christ.
“Listen to him!”
indeed.....
However, as it relates to the discussion, Peter's attempt to revere the "dead in faith" was to no avail.
God did not entertain it; the point of the story was that God was re-affirming the superiority of the Son and the attempt to recognize the status of Moses and Elijah was rejected. This should not be cited as an example whereby the dead in faith should be communicated with by the living as so many catholics do...quite the opposite.