If you owe IRS and MO both from prior years, this is how it work.
Say you owe IRS for example $2,000 and MO $1,000.
The IRS refund will all be applied to IRS, until IRS is paid and then if some left it goes to MO until MO is paid.
The MO refund will all be applied to MO, until MO is paid and then if some refund left it goes to IRS.