There are multiple reasons why that happened. First, your potato mix is loose. It must be tight enough to hold the round shape. Second, the all-purpose flour coating was thin. It must be thick. Third, the oil temperature was too high for the balls to be in one piece. Last but not least, your cheese cubes are too large.