I have a personal view that Āḷāra Kālāma & Uddaka Rāmaputta were annihilationists. There are subtle hints at this in the suttas. For example the suttas say that out of all the non-Buddhadhamma doctrines, annihilationism was the best
‘I would not be, neither would there be what is mine. I will not be, neither will there be what is mine.’
This view is said to be close to non-clinging and out of all of the speculative metaphysics doing the rounds at the time, this is said to be the foremost view:
(8) “Bhikkhus, of the speculative views held by outsiders, this is the foremost, namely: ‘I might not be and it might not be mine; I shall not be, and it will not be mine.’ For it can be expected that one who holds such a view will not be unrepelled by existence and will not be repelled by the cessation of existence. There are beings who hold such a view. But even for beings who hold such a view there is alteration; there is change. Seeing this thus, the instructed noble disciple becomes disenchanted with it; being disenchanted, he becomes dispassionate toward the foremost, not to speak of what is inferior.
AN 10.29: Paṭhamakosalasutta—Bhikkhu Bodhi (suttacentral.net)
We are then told elsewhere that upon his awakening the Buddha wanted to find Āḷāra Kālāma & Uddaka Rāmaputta, his former teachers, as they would easily grasp the Dhamma and awakening. Sadly, they had already died but the fact that he sought out Āḷāra Kālāma & Uddaka Rāmaputta first could perhaps be because they held the foremost view among the ascetics, namely the annihilationist doctrine. This would match the general character of the annihilationist doctrine, which is close to non-clinging, and would explain their use of the formless attainments. The suttas also associate the formless attainments with annihilationist views, as Venerable Anālayo points out
DN 1 at DN I 37,1 and its parallels DĀ 21 at T I 93b20, T 21 at T I 269c22, a Tibetan discourse parallel in Weller 1934: 58,3 (§191), a discourse quotation in the *Śāriputrābhidharma, T 1548 at T XXVIII 660b24, and a discourse quotation in D 4094 ju 152a4 or Q 5595 tu 175a8. The same versions also attribute the arising of annihilationist views to the immaterial attainments (for Sanskrit fragments corresponding to the section on annihilationism see also Hartmann 1989: 54 and SHT X 4189, Wille 2008: 307).
We see this again in MN 140, where it suggests that entry into the formless is to tend towards non-existence
“He understands thus: ‘If I were to direct this equanimity, so purified and bright, to the base of infinite space and to develop my mind accordingly, this would be conditioned. If I were to direct this equanimity, so purified and bright, to the base of infinite consciousness…to the base of nothingness…to the base of neither-perception-nor-non-perception and to develop my mind accordingly, this would be conditioned.’ He does not form any condition or generate any volition tending towards either being or non-being. Since he does not form any condition or generate any volition tending towards either being or non-being, he does not cling to anything in this world. When he does not cling, he is not agitated. When he is not agitated, he personally attains Nibbāna. He understands thus: ‘Birth is destroyed, the holy life has been lived, what had to be done has been done, there is no more coming to any state of being.’
MN 140: Dhātuvibhaṅgasutta—Bhikkhu Bodhi (suttacentral.net)
When we look at the parallels, the parallel to SN 47.31 even explicitly states that Uddaka Rāmaputta was an annihilationist:
"Uddaka Rāmaputta had this view and taught like this, “Existence is an illness, a tumour, a thorn. Those who advocate nonperception are foolish. Those who have realized [know]: this is tranquil, this is sublime, namely attaining the sphere of neither-perception-nor-nonperception.”
The Discourse on Uddaka [Rāmaputta] - MĀ 114
With all this in mind then, if the Buddha’s two teachers were practicing a form of annihilationism I think we get the following narrative from these texts. The Buddha-to-be, recognising the suffering inherent to existence, sought out a way to end “his” existence. However, after practicing with the foremost annihilationists of his time (Āḷāra Kālāma & Uddaka Rāmaputta) he came to realise that that Dhamma merely leads to another subtle form of existence, and so suffering would still be. Next then he attempts to master pain, as through mastering pain his mind will be untroubled and nibbāna obtained. Pain however is always pain. It cannot be anything else but pain. It can be tolerated, but mastering pain still does not bring about the total peace the Buddha-to-be is looking for. Next then he tries the Jhāna which, interestingly, are associated with the eternalists. With being, rather than non-being. Through this he finds refined states of mind which are peaceful, but even these lofty states are impermanent. They cannot be maintained, and so are still subject to dukkha. Finally then, upon realising the conditionality of all of these states he lets go. When the narrative then tells us, with these assumptions, is that the Buddha first sought out non-being. He then tried asceticism and forceful control of the mind. Finally he then tried blissful states of being. Finding all three to be unsatisfactory (non-being, being and asceticsm) he finally let go and found true peace which doesn’t depend on any conditions, namely nibbāna.
Now with all this, what was wrong with the formless attainments isn’t so much the attainments themselves. It’s as Bhante said, the view and so the clinging to these attainments. As such, for those who incline towards them, they can also be a basis for liberation if viewed correctly. One can understand that there never really is someone there who suffers to begin with, and so following the dimming and annihilation of the mind (via Nothingness and Neither perception-nor non-perception) merely creates more of the same suffering one was trying to escape from to begin with. Āḷāra Kālāma & Uddaka Rāmaputta then were so close to nibbāna. It was merely their subtle clinging to conditioned attainments, because of the view that “they” were real and so suffered, which held them back.