Molecular dynamics simulations are performed to provide a detailed understanding of the functional degradation of nano-scaled NiTi shape memory alloys containing amorphous regions. The origin of the experimentally reported accumulation of plastic deformation and the anomalous sudden increase of the residual strain under cyclic mechanical loading are explained by detailed insights into the relevant atomistic processes. Our work reveals that the mechanical response of shape-memory-alloy pillars under cyclic compression is significantly influenced by the presence of an amorphous-like grain boundary or surface region. The main factor responsible for the observed degradation of superelasticity under cyclic loading is the accumulated plastic deformation and the resultant retained martensite originating from a synergetic contribution of the amorphous and crystalline shape-memory-alloy regions. We show that the reported sudden diminishment of the stress plateaus and of the hysteresis under cyclic loading is caused by the increased stability of the martensite phase due to the presence of the amorphous phase. Based on the identified mechanism responsible for the degradation, we validate reported methods of recovering the superelasticity and propose a new method to prohibit the synergetic contribution of the amorphous and crystalline regions, such as to achieve a sustainable operation of shape memory alloys at small scale.