If it was going to fail, it had to be before Champion Hill, and would be because Johnston and Pemberton are able to link up before the battle and bring about enough numerical advantage to win. If the Union Army loses at Champion Hill, they have nowhere to fall back to except a difficult trek back to the river (keep in mind that the road network was poor, and the roads led back towards Jackson for Grant, so he would have had to somehow get his beaten army over bad terrain south until he reaches the road he took towards Jackson to start with, probably losing many men during the retreat, not to mention Sherman being totally isolated and destroyed in detail as he had to arrive late to Champion Hill) , where they could either evacuate or take shelter somewhere under the guns of the river fleet.
Or perhaps, Porter's attempts to run the guns of Vicksburg could fail, and then Grant is not going to be able to do anything until Port Hudson falls.