FFT of a AM modulated signal
There two definitions for the AM modulated signals
The first one is called as the classical-AM (or conventional AM) and is given by
$$x_{AM}(t) = (A_c + m(t)) \cdot \cos(2\pi f_c t) \tag{1}$$
and the second one is called as the DSB-SC (double side-band suppressed carrier) and is given by:
$$x_{AM}(t) = m(t) \cdot \cos(2\pi f_c t) \tag{2}$$
In your code, you use Eq.2 (DSB-SC) for the first example, and Eq.1 (classical AM) for the second example. Their difference is that the first one includes the carrier spectrum (the middle spike at $f_c$) at the output in addition to the modulating signal spectra (side-band spikes). The latter DSB-SC, however, only includes the modulating signal side-band spectra
and not the carrier spectrum, hence the name suppressed carrier.
DSB-SC has the advantage that the tranmission energy is reduced as the permanently radiating carrier energy is saved yielding a more efficient transmission. Whereas the classical AM, which is less energy efficient to broadcast, has the advantage that its demodulation (by analog hardware) is extremely simple requiring what's known as the envelope detector (a diode, a capacitor and a resistance, in addition ot the antenna receiver and audio amplifier circuitry).