Effect of anharmonicity of a cage potential for a magnetic ion vibrating in a metal is investigated by the numerical renormalization group method. The cage potential is assumed to be one-dimensional and of the double-well type. In the absence of the Coulomb interaction, we find continuous crossover among the three limiting cases: Yu-Anderson-type Kondo regime, the double-well-type Kondo one, and the renormalized Fermi chain one. In the entire parameter space of the double-well potential, the ground state is described by a local Fermi liquid. In the Yu-Anderson-type Kondo regime, a quantum phase transition to the ground state with odd parity takes place passing through the two-channel Kondo fixed point when the Coulomb interaction increases. Therefore, the vibration of a magnetic ion in an oversized cage structure is a promising route to the two-channel Kondo effect.