I had 5,800 removed from my IRA for UBTI

I am losing 5,800 to UBTI, a term which is completely new to me. I am a member of a stock club, and 20 yrs ago I bought EPD, which is a limited partnership. All I knew about LP is that is better tax wise to keep it in a retirement account, and it made good interest. I decided due to having special tax form complications, i sold 355 shares in 2024. I received a notice from my brokerage that it triggered a UBTI, and my brokerage will take 5,800 from my IRA to pay taxes on my partnership, as having the stock makes me a “partner”, and the company has debt, to my understanding.
I would love to be able to reverse or fix this, but the brokerage is sending a form to IRS, and I am losing all of the appreciation that I made, which i paid taxes on last year.
Can I use this as a loss in 2025, since that is when broker will remove the amount from my IRA?

Just a guess because I looked it up…

What Is Unrelated Business Taxable Income (UBTI)?

Unrelated Business Taxable Income (UBTI) is the income earned by a tax-exempt entity from activities that are not related to its exempt purpose. The Internal Revenue Service (IRS) defines UBTI as “income from a trade or business, regularly carried on, that is not substantially related to the charitable, educational, or other purpose that is the basis of the organization’s exemption.”

Yep, seems like since that income is in your IRA it should be Tax Free until you withdraw it but it isn’t. I waltzed around with UBTI for years before I was able to get rid of the entity that generated it.
Some investment companies will generate a UBTI Tax Return for you, most won’t. I think that is the best way to go if you can. Otherwise try and find an Enrolled Agent that is familiar with a UBTI return.
Also, if you live in a state that has State Income Tax you will likely owe Tax on that UBTI to them too.
I never could find a Tax Preparer that was familiar , so ended up filling the Returns myself.
Bumbled through it all with various IRS Penalties until I could finally be rid of that “good “investment”.
It is amazing how quickly one can get into trouble with IRS and end up with penalties. Although, I have successfully appealed several penalties when my Tax Preparer said there was no way. Of course that “refund” gets applied to your “income” so you have to pay tax on that. It never ends.
Now I stay away from any of those “good” investments” and just use Vanguard ETFs. Life is so much easier.

iShares, Charles Schwab, and SPDR ETFs are good also. I use Vanguard, iShares, Schwab, SPDR.

I understand that if a company owns debt, i pay for it when i sell shares.
If i only sell under 1,000.00 a year it will not trigger UBTI.
My brokerage sent the tax form to IRS, and told me they were removing funds from my retirement account to pay that companies taxes.
Once that is done, is there anything I have to do?
Since most traders buy and sell not knowing this about partnerships, there needs to be more information out there, and red flag warnings.

This from Fidelity

It sounds like maybe you’re “good” , if they filed a 990-T for you.