SN 48.40 is corrupt. If you look at the Agama parallel, it’s completely different, and works much better with a straightforward EBT interpretation of jhāna.
If you google for the pdf of:
Clarification on Feelings in Buddhist Dhyāna/Jhāna Meditation
there’s a good summary and comparison of the differences.
Here is a footnote by b.bodhi , and an excerpt from the “Clarification” paper (with glitches because the text was grabbed from pdf with special font).
b.bodhi comments:
There are some difficulties with what is said in the Uppat .ipat .ika
Sutta:
(1) Commenting on the statement that the domanassa faculty
ceases in the second jhana , Ven. Bodhi (2000: 1935) says,
‘‘This seems difficult to square with the usual jh ana formula,
which indicates that the first jh ana is already free from all
unwholesome states, including domanassa.’’ This remark is in
accordance with the facts that the usual jhana formula says
that one enters the first jhana having been secluded from
unwholesome states (vivicca akusalehi dhammehi … pat .hamam
. jhanam . upasampajja viharati), and that the jhana formula is often preceded by a formula on sense restraint as a
preliminary to the jhanas , which includes domanassa in evil
unwholesome states.8
Clarification on Feelings in Buddhist Dhyāna/Jhāna Meditation
Tse-Fu Kuan
Journal of Indian Philosophy, 33: pp. 285 – 319 © Springer 2005
Theravadins, Sarvastivadins and Sautrantikas
SN 48.40 Uppāṭika sutta: describes how each of the 5-fold vedana ceases in a different jhāna (or formless attainment).
sarvastivadin Abhidharmamr.ta(rasa)-sastra
Yogac arabh umi quotes it from the Avipar itaka Sutra ( Wu dao jing
As to the Sautrantika views, I shall refer to the Abhidharmakos´abhas
.ya by Vasubandhu in the fourth or fifth century A.D
Conclusion:
The foregoing passage of the Aviparitaka Sutra preserved in the
Sanskrit and Chinese literature provides a plausible account of the
order in which specific feelings cease in different jhanas , which fits in
quite well with the usual jhana formula. Its Pali counterpart in the Uppat.ipat.ika Sutta, however, contradicts the usual jhana formula in
three respects and has caused difficulties to Theravada exegesis.
Similarly, some doctrines of the Sarvastivada Abhidharma also contradict the usual jhana formula. The two schools use the same
approaches to iron out their respective contradictions, but by so
doing they get into other inconsistencies and complexities, and
unsurprisingly the two schools sometimes arrive at different conclusions although using the same approaches. In contrast, the
Sautrantika interpretation of sukha appears to be consistent with the
earliest texts. Such a ‘Sautrantika’ approach, i.e. taking sutras as criteria, adopted by this essay shows that the earliest accounts suffice to elucidate each other regarding the issue of feelings in jhana , and
that a plausible and consistent interpretation can be drawn from the
earliest texts rather than from some later literature. In conclusion, we
can accept the Aviparitaka Sutra account that domanassa, dukkha,
somanassa, sukha and upekkha cease successively as one proceeds
from lower to higher meditative attainments, and these five terms in
this account are not different from those in the usual jhana formula. It is not necessary to equate sukha of the first three jhanas to somanassa as the Theravadins do, or to identify sukha of the first two jhanas with prasrabdhi (a volitional formation, not a feeling) as the Sarvastivadins do. Neither is it necessary to interpret upekkha in the jhanas as a volitional formation as the two traditions do. The process of reducing
feelings as prescribed in the scheme of jhana conforms with what is
stated in the Sal.ayatanavibhan.ga Sutta: first developing pleasant
feeling and eliminating unpleasant feeling; then abandoning pleasant
feeling and achieving upekkha .