Is there consensus between Christian commentators about how Jesus came to be atop the temple when being tempted by Satan in the wilderness? After his baptism we read that Jesus went off into the wilderness fasting for 40 days and being tempted by the devil. 
Matthew 4:1-11 NIV:


  1 Then Jesus was led by the Spirit into the wilderness to be tempted by the devil. 2 After fasting forty days and forty nights, he was hungry. 3 The tempter came to him and said, “If you are the Son of God, tell these stones to become bread.”
  4 Jesus answered, “It is written: ‘Man shall not live on bread alone, but on every word that comes from the mouth of God.’”
  5 Then the devil took him to the holy city and had him stand on the highest point of the temple. 6 “If you are the Son of God,” he said, “throw yourself down. For it is written:
  He will command his angels concerning you,  and they will lift you up in their hands,
      so that you will not strike your foot against a stone.’”
  7 Jesus answered him, “It is also written: ‘Do not put the Lord your God to the test.’”
  8 Again, the devil took him to a very high mountain and showed him all the kingdoms of the world and their splendor. 9 “All this I will give you,” he said, “if you will bow down and worship me.”
  10 Jesus said to him, “Away from me, Satan! For it is written: ‘Worship the Lord your God, and serve him only.’”
  11 Then the devil left him, and angels came and attended him.


For this temptation to hold to the pattern of a man being tested the danger of a deadly fall would need to be a reality.
What explanations do Christian commentators offer for how Jesus came to be standing atop the temple during this temptation?
To answer the question from a Jehovah's Witnesses perspective, this question was asked by a reader of the Watchtower, and it was answered in the following way in the March 2016 study edition of the Watchtower &quot;Questions From Readers&quot; section:

Did Satan physically take Jesus to the temple when tempting him?
Put simply, we cannot be certain whether Jesus actually stood in the temple or he did so only by means of a vision. At times, both possibilities have been presented in our publications.
Consider first what the Bible record says. In his Gospel account of this event, the apostle Matthew was inspired to write: “Then the Devil took him [Jesus] along into the holy city, and he stationed him on the battlement  of the temple.” (Matt. 4:5) Luke’s parallel account puts it this way: “He then led him into Jerusalem and stationed him on the battlement of the temple.
Some have stated that, as a non-Levite, Jesus was not authorized to stand on top of the temple sanctuary. So it was assumed that Jesus may have been ‘taken along’ to the temple by means of a vision. That is similar to what happened centuries earlier to the prophet Ezekiel.—Ezek. 8:3, 7-10; 11:1, 24; 37:1, 2.
However, if this temptation occurred only in the form of a vision, the following questions arise:

Was the temptation real or imaginary?
If the other temptations were efforts to lure Jesus into carrying out physical actions such as turning literal stones into bread or performing a real act of worship before Satan, would not this temptation have been similar—requiring Jesus physically to jump from the temple?

On the other hand, if Jesus did stand physically on the battlement of the temple, other questions arise:

Did Jesus violate the Law by standing on top of the sanctuary?
How did Jesus get from the wilderness to Jerusalem?

Further research helps us to see some possibilities that may answer these last two questions.
First, Professor D. A. Carson notes that the Greek word hi·e·ron’, translated “temple” in both accounts, “probably refers to the entire complex, not the sanctuary itself.” So Jesus would not necessarily have had to stand on top of the sanctuary itself. He could have stood, for example, on the southeastern corner of the temple area. From that location, there was a drop of some 450 feet (137 m) to the floor of the Kidron Valley. The southeast structure had a flat roof with a parapet and was the highest in the temple. The ancient historian Josephus stated that if a person stood there and looked down, he “would become dizzy” because of the height. As a non-Levite, Jesus would have been allowed to stand in that location, and his doing so would not have caused any commotion.
But how could Jesus have been taken along to the temple when he was in the wilderness? The basic answer is that we cannot know for certain. The brief description of the temptations does not state how long a period was involved or where Jesus was in the wilderness. We cannot rule out the possibility that Jesus may have walked back to Jerusalem, even though doing so may have taken some time. The account does not specifically say that Jesus remained in the wilderness throughout the time of the temptations. Rather, it merely says that he was taken into Jerusalem.
What, though, of the temptation wherein Jesus was shown “all the kingdoms of the world”? Obviously, he did not literally see all the kingdoms; there is no literal mountain from which all of them can be seen. So Satan may have used some sort of vision to show these to Jesus, similar to the way a projector and a screen can be used to show someone pictures of various places on earth. However, although a vision may have been used, the “act of worship” would have been real, not imaginary. (Matt. 4:8, 9) It could be argued, then, that the temptation to jump off the battlement of the temple involved a real action with real consequences—adding a greater seriousness to this temptation than would be the case were it a mere vision.

The Jehovah's Witnesses position on the question seems to agree with other religious commentaries on the subject. Basically, we can't say for certain that this temptation actually happened atop the temple or not, but it is certain that, as was the case in the other 2 temptations, Jesus would have had to take some real action that would have been contrary to almighty God's purpose and would have constituted a sin. We can be inspired by the fact that Jesus was able to conquer the Devil on each occasion.