Size-dependent reversal of the elastic interaction energy between misfit nanostructures