In the "twins on a spaceship" scenario the interchangeability breaks down because there are not two but three relativistic frames - the stationary one; the frame moving away from Earth very fast, and the frame moving towards the Earth very fast. It's not really the acceleration per se, but the combination of these two different frames (of course, switching between them requires changing velocity and thus acceleration) that result in that twin being younger.