Should I buy out my 2017 BMW x1 sDrive28i (m sport, premium) at $24k?

I think you need to double check the buyout process. The residual value is the buyout, no discount. The dealer cannot give you a discount on a car they don’t own.

Have you also checked Vroom/Carvana to see what the market value on the car is?