Your problem is that \pgfmathsetmacro{} is rounding the number and the range of numbers of pgfmath is quite limited (see note 2). I have added a debug node to show you that your \l (see note 1) is 0.0...
I suggest using the declare function facility for this kind of thing (besides, the syntax is much better). There will be still limitations in the range of numbers, and the dimension too large error is very easy to have, but it's much more stable.
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning,calc}
\usepackage{pgfplots}\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\l}{(20e-6)}
\tikzset{declare function={
L=20e-6;
R=4;
C=(1/20)*1e-6;
}
}
\node[red] at (3,3) {l is \l}; % just to debug
\begin{axis}[
xmin=1,
xmax=2e6,
samples=150,
xlabel=$\omega$]
\addplot[domain=2:2e6, black, thick] {1/(1 + (x*L/R - 1/(x*R*C))^2)};
\end{axis}
\end{tikzpicture}
\end{document}

note 1: try not to use one-letter macros. It is very dangerous because a lot of them are defined for accents in the core LaTeX, and things can explode in unfathomable ways.
note 2:
The pgfplots manual says:

but be warned that using the fpu manually can be tricky.
There are other mathematical engines around, like xfp for example, which are more "standard", but not so well integrated into the rest of pgf. For very complex calculations, is better to use external tools and then import the data points.