Reminder about Nyquist-Shannon
By the theory of sampling, sampling a signal in the time domain results in periodisation of this signal in the frequency domain, at the period Fs (where Fs is your sampling frequency). Shannon-Nyquist's theorem explains that in order to not loose information when sampling a signal, there shouldn't be overlapping of the periodic repetitions of the signal's spectrum. Considering that the period of repetition is Fs, the total width of your signal's spectrum should exceed Fs.
Moreover, analog signals are real which means their spectrum is symetric relatively to the f=0Hz axis. Thus, if your signal's FT must have a maximum width of Fs, it means that your maximum frequency to avoid overlapping should be Fs/2.
Now that your signal is correctly sampled i.e. there is no overlapping of the spectrum patterns in the frequency domain, you want to reconstruct it in the analog domain for example for audio playback. As explained before, sampling results in a periodisation of the analog signal's spectrum. That means that to go back to a continuous signal, you have to extract only one of the periods of your signal. To do that without distorting your signal, you need an ideal brick-wall filter (infinitely sharp transition band) called a reconstruction filter.
Unfortunately, such a perfect filter is impossible to obtain. Indeed, its impulse response is a cardinal sine (Fourier transform of a gate) which by definition is infinite on both sides of the central lobe.
It can however be approached with very high order FIR filters or convolution with a windowed sinc (this is a pretty deep subject, there's plenty of resources on the internet).
Answer to the original question
Depending on the quality of your reconstruction filter, sampling your signal close to Nyquist will indeed result in a distorted signal. That doesn't mean Nyquist theory is wrong, it is only theory. Depending on your DAC, you often want to oversample your signal if you need very high fidelity. Again, sampling you signal at a higher frequency will result in a periodisation of the signal at a longer period, which basically gives more space for your filter's transition band. The wider the transition band, the more oversampling you will need. As an example, the linear interpolation that your plotting software uses has the frequency shape of a squared sinc. It will thus completely distort your signal.