Existence of the bouncing ion between the plug potentials improves the axial confinement of the tandem mirror plasma. Trajectories of the bounce ion passed through the anchor cells with nonaxisymmetric magnetic configuration was calculated on the assumption that the shape of the magnetic flux tube was shifted from the shape of the equipotential surface of the plasma at the mirror throats of the anchor cells. It was found that the discrepancy between the shapes enhanced the radial drift of the bounce ion. Radial potential profile of the core plasma was controlled by adjustment of the radially separated endplate potentials, and it was indicated that flattened radial potential profile was effective for the decrease of the radial drift.