I consider that they may be discontinued in the same year.
If Xbox 5 is gonna launch in 2026, then Xbox Series may be stopped to be produced in late 2027. Xbox One was discontinued in early 2021 but it feels like they wanted to avoid some shortages of XS. Maybe Xbox One could have been produced a few more months without shortage thing - until the end of 2021.
If Xbox 5 launches in 2027, then Series may be stopped to be produced in late 2028. Don't think that X5 will appear in 2028 considering that there isn't "Pro Console" from them during XS life cycle. It's the choice between 2026 and 2027 at the moment.
Switch might be produced for a bigger period of time, probably 2 years after the start of NextGen Switch. (in 2027 or early 2028)
So there's a chance that both consoles may leave manufacturing in the same year. But it's hard to say which will be first. It depends on XB5 launch window.