I disagree that pessimism is a luxury, because pessimism does not adhere to the definition of luxury, and because it does not do that, it cannot be logically considered a representative of the value of luxury.
What is luxury? Luxury is an unnecessity only those who are considered the “elite” can afford and remaining resourceful nonetheless. Pessimism, while not always a necessity, is accessible to all people, whereas a luxury is only accessible to a small amount of people that are powerful in some way, that can afford said luxury thanks to their power.
Pessimism can be compared with tea without sugar. Both are bitter and may be difficult to drink - even insufferable for some - but both, nonetheless, can be afforded by most people in our population.
The quote that assigns pessimism with luxury was more likely a way to inspire people to avoid it, because of its counter-productivity both for individuals and collectives alike - an attempt to cheer people up and not give up. However, a recommendation of something to be avoided does not alone grant it its position under the umbrella of luxury.
But of course, it is the function of a quote, rather than its logical correctness, that brings it its valuable practicality, because as long as people will believe in its power, whether it is correct or incorrect, that makes it to become effective.
Another examples of quotes that fall into this category are “There is no despair in the world” and “One’s living comes from the sky”. Both are logically false, but both are, nonetheless, believed in, because of their practical function to those who believe in their effective power towards whatever they wish to achieve and preserve.