This happened with the iPhone 5 as well when the 5S and 5C were released, logic being that the 5C serves as an exact-replacement for the 5 (minus the plastic shell).
In this instance, the iPhone XR serves as a hybrid upgrade of the iPhone 8/8 Plus and the X.
Don't let "discontinued" confuse you for warranty/parts/repair. Those will still be readily available. Heck, every single iPhone X on the planet is still under the standard one-year warranty (excluding those who have violated the terms).
Dont they always keep the previous version when S version is released. Like iPhone 7 and 7s, 6 and 6s and so on.... Guess, they just re-branded iPhone X to iPhone Xr with new colors and sell it as a new phone.