Chaotic scattering and acceleration of ions in the Earth's magnetotail