Why is but used at the end of a sentence (below, a sentence from Wikipedia)

Christmas should be a time of joy, but for thousands of people sleeping rough, in tents or on public transport it will be anything but.


"anything but" is a common idiom.

https://dictionary.cambridge.org/pl/dictionary/english/anything-but

https://www.merriam-webster.com/dictionary/anything%20but