Who knows? We don’t have a record of the Buddha’s thoughts, only a very partial record of what he taught. Beware of inferences from absence.
This episode is almost always misinterpreted because people ignore the kind of text they’re dealing with. It is a narrative, and its purpose is to tell a story. Comparing state-to-state is not the point. What matters is to understand the role the states play in the narrative. This is a systematic problem in modern Sutta interpretation: we have too many engineers and not enough story-tellers and poets!
Let me illustrate this by paraphrasing the story of the Buddha’s former teachers in a more familiar narrative style. The exact nature of the teaching of the two former teachers is not stated in the texts, so I indicate this with [square brackets].
The bodhisatta, looking for the end of the cycle of birth, ageing, and death, tried to find the answer by studying under the foremost contemplative teachers of his time.
He mastered the theory and texts [of the Upanishads], but unsatisfied with mere book learning, he wished to experience the advanced states that were described in the texts. His teachers encouraged him, even though these states were so very subtle and difficult that only one of his teachers had actually achieved what he taught, while the other was just passing down second-hand knowledge of his own teacher’s experiences.
The bodhisatta went on to achieve mastery of the peaceful states of meditation (samādhi AKA the four jhanas) and beyond, even to the exotic and elusive formless states. His teachers were so impressed that they invited him to lead their communities—they had never before witnessed a student so talented.
However, he realized that even these, the very highest and most sublime states taught in the spiritual circles of his contemporaries, aimed not to the ending of rebirth but to rebirth in the Brahma realms [following the Upanishadic philosophy]. He became disillusioned with that philosophy (dhamma) and departed to pursue his original quest.
The overriding imperative of the narrative is to depict the bodhisatta as one who has achieved the very highest that any contemplative alive had done; that he was, even before awakening, a spiritual master of all traditions. It’s not about the states. That’s just an implementation detail. He is said to have experienced the formless states because that’s what is regarded in Buddhism as the highest states achievable by non-Buddhists.
The Upanishadic theory (as interpreted by Buddhists) posits that the practice of jhanas brings you to the state of Brahma (which a Buddhist would agree with), and that that state is permanent and eternal (which a Buddhist would disagree with). When practicing jhanas under his former teachers, the bodhisatta was already trained in the Upanishadic philosophy to see the experience of samadhi through this lens. Wrong view, however, leads to wrong samadhi, and wrong samadhi doesn’t lead to liberation.
Compare with the narrative context of the recollection of jhana as a child, once again paraphrased to bring out the narrative force:
Disillusioned with his painful exertions [under the Jains, and also following his earlier experience under the two Upanishadic teachers], the bodhisatta realized that he could not find the path he sought among the spiritual practitioners of his time.
Even though he had been inspired to follow their example, and had learned much under their guidance, at the end of the day, it turns out that none of them had truly realized the ending of rebirth. They were still bound by their theories and ideas, which aimed at providing some sense of personal continuity, at achieving a permanent state of bliss for the self. But such states were produced by conditions, and anything produced by conditions could not be eternal. It seems he must abandon the idea that he could achieve awakening by following the teaching of others.
What, then, was his path? How could he move forward? Had he wasted the last six years?
Since he could not rely on others to show him the path, he was of necessity thrown back on to his own experience. It took him six years to learn this lesson: that the spiritual path was something he had to find for himself.
Then he recalled a long-forgotten episode from his childhood. Sitting under a rose-apple tree while his father was off working, he went into a peaceful state of meditation. Even as a child! He knew no philosophy, was following no path, had submitted to no guru. And yet this peace was there, falling unasked upon a child in nature.
“Might that be the path to awakening?" he wondered. And as soon as he thought that, somehow he intuitively knew: “Yes! That indeed is the path to awakening!”
Since that state was not embedded in a philosophy, it was not associated with wrong view. It was just a state of nature. This was the key insight: that peaceful states of meditation are not a manifestation of a specific metaphysical view, but are simply a condition of the mind. This opened up the possibility of the Buddha’s way of letting go.