How to properly convert from dB back to amplitude I am new to signal processing.

I have a signal that I want to convert to dB, process and then transform back.

My understanding of the transformation to dB scale is

$X_\mathrm{db} = 20 \cdot \mathrm{log}_{10}(|X|)$ and therefore $|X| = 10^{X_\mathrm{db} / 20}$

However, when calculating the reverse of my audio the sample sounds distorted. See reproducible example below

Can someone explain why this occurs?

import wget
import os
import librosa
import IPython.display

filepath = str(os.getcwd()+"/metallic-drums.wav")
wget.download("https://tinyurl.com/wx9amev", filepath)

MD, sr = librosa.load('metallic-drums.wav')

#Playing the orginal file
IPython.display.Audio(MD, rate = sr)

#Chaning to db
MD_db = librosa.amplitude_to_db(MD)
#Changing back to amp
MD_r = librosa.db_to_amplitude(MD_db)

#Play the result
IPython.display.Audio(MD_r, rate = sr)
You have the abs(X) in the formula, which is not a reversible operation.

All the negative values in the original audio sample has been converted to positive.