The difference between the formless realms and extinguishment is the degree of emptiness. In MN121, the Buddha advises Venerable Ānanda on the progressive stages of the meditation on emptiness. Here is the transition leaving the realm of form:
MN121:6.1: Furthermore, a mendicant—ignoring the perception of wilderness and the perception of earth—focuses on the oneness dependent on the perception of the dimension of infinite space.
In the above, the perception of wilderness is unsatisfactory in its impermanence, so it is natural to proceed onward to the formless. Indeed, the meditation on emptiness proceeds deeper and passes through the formless, leaving it here:
MN121:10.1: Furthermore, a mendicant—ignoring the perception of the dimension of nothingness and the perception of the dimension of neither perception nor non-perception—focuses on the oneness dependent on the signless immersion of the heart.
In each transition noted during meditation, the preceding stage is perceived as unsatisfactory and impermanent. Relinquishing each attachment opens up greater freedom. Indeed, the transition out of the formless is the eighth and final liberation.
DN34:2.1.206: Going totally beyond the dimension of neither perception nor non-perception, they enter and remain in the cessation of perception and feeling.
DN34:2.1.207: This is the eighth liberation.
Note that the conceit "I am" still permeates the formless. The observer still sees. When the observer sees, there is "this and that". With "this and that" in mind, perception and feeling still bubble and perturb. That perturbation is disturbing and unsatisfactory because it is also impermanent--"that" appeared and "that" will disappear. If "that" is impermanent, then "this" might also be--that attachment to "this" causes anxiety. So one might attempt to perfect the formless, but that is pointless, an unsatisfactory dead end. Those who are stuck in the formless, are unwilling to accept "this" as impermanent. They cling to the notion that somehow perfecting the formless will lead to a subtle perpetuation of "this". But just as "that" appeared and disappeared, so too must "this".
Only in letting go of "this", the conceit "I am", does suffering cease:
DN34:1.4.27: Renunciation is the escape from sensual pleasures. The formless is the escape from form. Cessation is the escape from whatever is created, conditioned, and dependently originated.