I actually heard a seminary professor maintain that this was a case of Jesus being “absent minded”, forgetting to stick to His human abilities! but prior to that neglecting to get in the boat with the disciples when they set out.
It’s more reasonable to consider this as what John calls a “sign”, an action performed as a signifier of Jesus’ identity. In fact the account as written by John is intriguing because it uses a phrase quite common to Mark:
and immediately the boat was at the land to which they were going.
“Immediately” (“straightaway” in some translations) is so common in Mark it’s almost an identifying marker, but in John it’s used very sparingly. It should be noted, though, that “straightaway” is actually the better translation because the word εὐθύς or εὐθέως (same word, different spelling) doesn’t mean “instantaneously” but refers to an interval that is short but also uneventful. So John is contrasting the effort of the disciples rowing for several miles already and then the consternation of seeing Jesus walking calmly on what they’d been laboring through with the peace and calm – and presumably meditative silence! – after Jesus was in the boat.
Matthew’s version actually shows this as a “sign”, an action that reveals Jesus’ identity, writing:
And those in the boat worshiped him, saying, “Truly you are the Son of God.”
This is a bit of a follow-up to a different sign that happened earlier: Jesus commanding a storm to “chill!”, as one first-year NT Greek student I knew rendered it. On that occasion the disciples responded with questioning among themselves,
Who is this that the wind and sea obey Him?
Knowing their Old Testament scriptures they might have made the connection that it is God who stills the storm and calms the sea, but they didn’t quite make that leap, so we can see this action as a continuation of the lesson; they didn’t get it before, so Jesus ups the ante with a control of the sea that goes beyond just giving orders – walking on the sea declares His lordship over it without even needing to give commands; it serves Him as He wills.
Literary device? No: this shows the disciples in a bad light! They didn’t get the lesson when Jesus gave orders to the sea and weather, so it took this second demonstration to get the point across – and then the one disciple who had the courage to try going over to Jesus on the water fails in his faith just as he reaches Jesus!
It’s also interesting that John sandwiches the account with another failed lesson: seeing Him feed a huge crowd with just a small amount of food should have reminded many, even most of them of the manna God provided in the wilderness. They saw His disciples get into the boat and leave, but in the morning Jesus is also gone, and when they find Him back on the other side of the sea at least some of them ought to have recognized that something beyond the ordinary had happened. They do ask how He got there, but instead of answering that Jesus picks up on the (failed) lesson from the day before, first commenting on their motives for effectively chasing across the sea after the disciples when they couldn’t find Him, then shifting into the significance of His supplying bread the day before.
Now John’s arrangement, putting the incident in the middle of another lesson where the crowd of so-so-maybe disciples had to have things pointed out to them, with the core disciples also being rather obtuse, is perhaps a literary device – though I wouldn’t put it past Jesus to do it that way on purpose " to make a point or two for the benefit of his disciples and perhaps for Peter in particular."