"Basis coming out of the RMD is lowering the tax liability."
"even with the penalty the client's liability decreases by making a non deductible contribution. I am suspicious that it is a program error."
"with the penalty" is your sample scenario for increasing basis, so the RMD is going to be further allocated and the Basis portion is higher, as long as you have the entry for the nondeductible contribution (which isn't allowed, anyway). That isn't a program error. That's the math. If you need to, run the numbers on the IRS worksheet, using that $7k as basis or as additional basis, whatever applies to this person's scenario.
"Contribution and distribution in the same year.
If you received a distribution in 2019 from a traditional IRA and you also made contributions to a traditional IRA for 2019 that may not be fully deductible because of the income limits, you can use Worksheet 1-1 to figure how much of your 2019 IRA distribution is tax free and how much is taxable. Then you can figure the amount of nondeductible contributions to report on Form 8606."
"Level Up" is a gaming function, not a real life function.