"happy on the rack" is hard to accept as a simple premise. Perhaps Raimondi had this basic idea in mind.
But "having an enduring sense of mental well-being while in great pain" is possible and realistic -- of course Epicurus himself provided an example of this at the end of his life. I also saw it in my grandfather.