So let me see if I understand this. Suppose my traditional IRA funds a real estate purchase at 40% and I get a non-recourse loan for the other 60% on a condo purchased for $100,000. Sometime later the condo is sold for $200,000 (ignoring expenses and stuff for simplicity of my example). $40,000 of the $100,000 profit is taxed deferred. $60,000 of the profit is taxable as ordinary income. The tax on the $60,000 is paid by the IRA. What happens to the remainder ($60,000 minus the tax on $60,000)? Does it stay in the IRA, tax deferred, just like the other IRA funds? Suppose in this example the IRA was a Roth? What happens to the remainder then?
If your IRA held the property for over a year the $60,000 in profit related to the debt portion would be taxed as capital gains to the IRA. The money belongs to the IRA and after payment of the UBI tax, is no different than other funds in the IRA. It would be exactly the same in either a Roth or a traditional IRA.