I'm sorry you're having this problem. I know how MISERABLE it is. My boy sometimes did it numerous times a day! It would run off the shelf and down to other parts of the cage. It was so frustrating because it has to be dealt with immediately, so cage cleaning was a task I was performing many times a day.
Let me tell you my observation as to why it was happening, and what I did to resolve it. Shadowfax is in a Quality Cage Chinchilla Mansion. I used the four full length shelves that came with the cage in the cage design. He had a few sleeping places throughout the height of the cage. I observed he was doing it out of convenience. Instead of going all the way down to the bottom of his cage to pee, he would just back out of where he was sleeping and pee. Or if he was just hanging out on one of the longer shelves, he would back up a few steps and pee.
I was seriously at my wits end. So how I resolved it was to take away ALL the long shelves, and replace his cage with only 6" X 6" shelves, and NO sleeping places above ground level. He still gets all the exercise of jumping around, but he won't pee on a shelf he doesn't have the room to move aside on. That's it plain and simple. He hasn't pee'd a shelf since I made this change. Good luck!