There are a few different reasons why a snake gets an RI. Here's a couple...

One could be husbandry. Low temps and too high or too low humidity can cause RI's. Too large of an enclosure with no chance to hide in a small snug space.

Stressed conditions, such as over handling, busy area of the house, constant disruptions etc, can cause the immune system to weaken, leaving the door open for infection.

It could be secondary to another infection that's already wearing down her immune system.

I would look first at your husbandry. Ball pythons like to feel secure, I personally keep babies in 6-12 qt tubs until they reach 7-800 grams. From there they are moved into a 28, and large adult females can go into a 41.

Large enclosures can be made to work, by offering ample snug fitting hides and cover, ball pythons can successfully be kept in them. But if her health is taking a down turn, think about setting her up in a 12 qt tub for the mean time.