The conundrum is summarized by William Lane:
Because the text stresses that Jesus' coming to the disciples was the direct result of his perceiving their distress, the explanation that "he meant to pass by them" seems enigmatic, if not alien to the context.1
There have been three major approaches taken by commentators:
Jesus' stated "intention to pass by" the disciples is an explanation of how the event seemed to the disciples. R.T. France2 takes this view:
In the narrative context the clause is best seen not as a statement of what was in Jesus’ mind but of how his approach appeared from the disciples' point of view
In support of this, he finds similar language in Luke 24:28, where Jesus "acted as if he was going further" (see a question on Heremeneutics.SE if interested in that one), which is more clearly about the disciples' impression.
Jesus' stated intention was an expression of his desire to reveal himself as God. In this view, "pass by" means "pass in view of" rather than focusing on ignoring them or "walking on by".1 This is one plausible sense of the verb παρερχομαι, which has a broad semantic range. If so, verses 48b-49a could be rendered:
...he came to them, walking on the sea, for he intended to pass their way. They saw him...
Here the clause "for he intended..." is dependent on the preceding and provides an explanation for it. This is not the most obvious meaning of the Greek καὶ, but it is possible. The following verse then begins a new sentence, where the "but" in most translations is not required by the Greek.3
The emphasis on theophany in this passage finds support in verse 50 when Jesus reassures the disciples using the emphatic ἐγώ εἰμι (egō eimi) that is part of the "divine formula of self-revelation"6. This focus on the event as revelation of divinity does not deny that there is a shift in Jesus's plan as he walks.
Yet, precisely at this most "divine" moment...he also displays his humanness, for his will seems momentarily to be thwarted. He wishes to pass the disciples by for their own good, to give them a full revelation of his identity, but...he is called back to earth by the necessity of ministering to them.7
Regardless of whether they understand Mark 6:48 as expressing the disciples' viewpoint (#1) or Jesus’ intention (#2), commentators consistently identify a reference to several Old Testament theophanies.4 The notion of God "passing by" recalls Moses's experience at Sinai (Ex 33:19, 22) where this same verb – παρέρχομαι – is used in both verses in the LXX. Also, in 1 Kings 19:11, God "passes by" (παρέρχομαι) Elijah on Horeb (1 Kings 19:11). An even closer parallel to Mark 6 is found in the Septuagint of Job 9:8,11:
[The Lord,] who alone stretched out the sky
and walks on the sea as on dry ground
If he passed over me, I would certainly not see him,
and if he went by me, I would not even know. (NETS)
Here the transcendent Lord is represented both walking on water and "passing by" (again, παρέρχομαι) Job.
To summarize how Christian commentators have addressed the OP’s question:
Why was Jesus about to walk on water past the disciples?
Either "walk past" was just the disciples’ impression, or the term was chosen to reflect Jesus' decision to reveal himself as divine. Regardless, the OT background of passages where God appears to men figures centrally into the meaning of Mark’s account of Jesus' nocturnal sea-stroll.
1. William L. Lane, The Gospel of Mark (NICNT), Grand Rapids: Eerdmans, 1974. This commentary I also credit with the framework for this overview of exegetical approaches to this passage summarized here.
2. R. T. France, The Gospel of Mark: a Commentary on the Greek Text (NIGTC), Grand Rapids: Eerdmans, 2002. Apparently also Cranfield, although I do not have access to that commentary at the moment.
3. An interlinear will show you that there is a word – δὲ – that corresponds to "but". However, in contexts such as this (immediately following a personal pronoun that changes the (grammatical and topical) subject from the preceding clause), the δὲ likely functions primarily to change the subject rather than to introduce a logical contrast. If so, it is appropriately left untranslated or, as proposed here, represented by the start of a new sentence. Note that this shift of (topical) subject is against the proposal in #1 which holds that the last part of verse 48 has the disciples primarily in view.
4. In addition to the two cited above, James A. Brooks, Mark (New American Commentary), Nashville: Broadman & Holman Publishers, 1991; Joel Marcus, Mark 1-8 (The Anchor Yale Bible), New Haven: Yale University Press, 1974.
5. Brooks, ibid.
6. Lane, ibid. This formula is known in the NT primarily in the Gospel of John, and this is one of the few "absolute" (i.e. without complement) uses of the phrase as a claim to divinity outside of that book. (The other two are also in Mark: vv 13:6 and 14:62.) The Old Testament background is frequently traced to Ex 3:14, although Deut 32:39 via the LXX, Isa 43:10, and 45:18 via the LXX, have been considered more likely in recent scholarship focused on the issue.
6. Marcus, ibid.