Note: I assume, as mentioned in a comment, that we are dealing with $\sum_{l_x=0}^\infty e^{\Delta l_x^2}$ and $\int_0^\infty e^{-\Delta x^2} \, \mathrm{d}x$.
So, the thing is, except in very special circumstances, you're correct in that most sums do not meaningfully correspond to integrals. However, I would make the argument that your expressions for $q_x$ aren't equal either! For $\Delta = 10^{-17}$, Wolfram suggests
$$
\left|
\sum_{n=0}^\infty e^{-\Delta n^2} -
\int_0^\infty e^{-\Delta x^2} \, \mathrm{d}x \right|
\approx \frac 1 2
$$
(Wolfram link)
Definition of the Riemann Integral:
I'm not sure how necessary this is, but I feel it might be worth going over nonetheless, just in case.
The definition for the Riemann integral is actually not as described, but a tad bit more involved. We say
$$
\int_a^b f(x) \, \mathrm{d}x = I
$$
if and only if:
- For every $\varepsilon > 0$...
- ...there exists a $\delta > 0$...
- ...such that, if $P$ is a partition of $[a,b]$ with $\|P\| < \delta$...
- ...and $\Xi$ is a collection of tag points in the subintervals induced by $P$...
- ...then $|R(f,P,\Xi)-I| < \varepsilon$
Here:
- $P$ being a partition means we take points $\{x_i\}_{i=0}^n$ such that $a = x_0 < x_1 < \cdots < x_n = b$.
- The norm of $P$ is given by $\|P\| := \max |x_i - x_{i-1}|$
- $\Xi$ being a collection of tag points $\{\xi\}_{i=1}^n$ means that $\xi_i \in [x_{i-1},x_i]$ for each $i$. (Some might say $P \cup \Xi$ is a "tagged partition.")
- We then define the Riemann sum by
$$
R(f,P,\Xi) := \sum_i f(\xi_i) \Delta x_i
$$
and even write
$$
\lim_{\|P\| \to 0} R(f,P,\Xi) =: \int_a^b f(x) \, \mathrm{d}x
$$
Key Takeaway: Intuitively, what this means is that, as we add many, many points to the partition -- and as they get closer and closer together -- we can approximate the integral arbitrarily well. More precisely, if we know a precise error $\varepsilon$ we wish to achieve, there is a corresponding $\delta$ that the intervals can be no wider than.
What about $n\to \infty$?: That assumes a particular choice of partition, with equal spacing - say,
$$
\Delta x = \frac{b-a}{n}
\qquad
x_i = a + i \Delta x
$$
However, we can work more generally than that, and the general definition proves enlightening for this case.
Okay, but I have an integral with an infinite bound. The same definitions from Calculus II still hold:
$$\begin{align*}
\int_a^\infty f(x) \, \mathrm{d}x &:= \lim_{b \to +\infty} \int_a^b f(x) \, \mathrm{d}x \\
\int_{-\infty}^b f(x) \, \mathrm{d}x &:= \lim_{a \to -\infty} \int_a^b f(x) \, \mathrm{d}x \\
\int_{-\infty}^\infty f(x) \, \mathrm{d}x &:= \int_{-\infty}^c f(x) \, \mathrm{d}x + \int_c^\infty f(x) \, \mathrm{d}x \tag{for any $c \in \mathbb{R}$}
\end{align*}$$
So, when "converting"
$$
\sum_{n=0}^\infty e^{-\Delta n^2} \xrightarrow{\text{"converted into"}} \int_0^\infty e^{-\Delta x^2} \, \mathrm{d}x
$$
we need to consider what integrals of the type $\int_0^b e^{-\Delta x^2} \, \mathrm{d}x$ might even look like. For that, converting into Riemann sums, we would have something of the type
$$
\sum_i e^{-\Delta \xi_i^2} (x_{i+1}-x_i)
$$
(Above, $\Delta$ is explicitly your constant, and not the difference operator.) Notice that if you chose your partition to be the nonnegative integers, and your tag points to be the left endpoints of those intervals, these precisely match the sum you want to estimate.
The Role of $\Delta$ Being Small:
... okay this is all well and good, and justifies already the use of the approximation
$$
\sum_{n=0}^\infty f(n) \approx \int_0^\infty f(n) \, \mathrm{d}n
$$
for appropriate $f$. However, this is a very, very crude approximation. For particularly ill-behaved $f$, you could have an error on each "integer-width rectangle" that you use in the sum roughly equal to the maximum of the function over that interval.
(This pulls back to "integrals are areas under curves": the above estimation uses rectangles of width $1$ in particular.)
For instance, a comparatively well-behaved function like $f(x) = e^{-10x} - e^{-1}$ gets a lot of leftover area:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/1KcZTQR3.png)
(Generic version of this Desmos demo I made for my Calculus I students here.)
In fact, it is a known result that, via this "left endpoint estimation" rule, the Riemann sum $R(f,P,\Xi)$, with $P = \{x_i\}_{i=0}^n$ and $\Xi = \{x_i\}_{i=0}^{n-1}$, if $f$ is differentiable on $[a,b]$, then
$$
\left| R(f,P,\Xi) - \int_a^b f(x) \, \mathrm{d}x \right|
\le \frac{(b-a)^2}{2n} \sup_{x \in [a,b]} |f'(x)|
$$
Let's apply that to an integral of the type $\int_0^b e^{-\Delta x^2} \, \mathrm{d}x$, with the left-endpoint estimation rule and partition points at the integers. Then
$$
\left| R\left( e^{-\Delta x^2},P,\Xi \right) - \int_0^b e^{-\Delta x^2} \, \mathrm{d}x \right|
\le \frac{(b-0)^2}{2b} \sup_{x \in [0,b]} \left|\frac{\mathrm{d}}{\mathrm{d}x}e^{-\Delta x^2} \right|
= \frac b 2 \sup_{x \in [0,b]} \left|\frac{\mathrm{d}}{\mathrm{d}x}e^{-\Delta x^2} \right|
$$
You can even show that, for $b$ sufficiently large,
$$
\sup_{x \in [0,b]} \left|\frac{\mathrm{d}}{\mathrm{d}x}e^{-\Delta x^2} \right|
= \sqrt{ \frac{2\Delta}{e} }
$$
so
$$
\left| R\left( e^{-\Delta x^2},P,\Xi \right) - \int_0^b e^{-\Delta x^2} \, \mathrm{d}x \right|
\le \frac b 2\sqrt{ \frac{2\Delta}{e} }
= \frac{ b \sqrt{\Delta }}{\sqrt{2e}} \tag{$\ast$}
$$
Anecdote: Amusingly, plotting what Desmos considers the error, and the error bound, while the error bound is proportional to $\Delta^{1/2}$, the error itself seems to scale linearly.
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/wiXpUKRY.png)
This may be an artifact of the estimation methods used by Desmos, especially since $e^{-x^2}$ decays very fast. Not that it matters here, since we want $\Delta$ small. Here's a link to my demo.
The takeaway, then: why choose $\Delta$ to be small? Because then the error will be correspondingly quite small, with a suitable upper bound as given in $(\ast)$. Equality is unlikely to be achieved, but taking $\Delta$ this small presumably makes the error negligible, and integrals are usually easier to treat and handle in many situations.
In short, then: You cannot convert sums to integrals like this most of the time in any meaningful sense, but I believe that's not what we care about here: instead I believe what's at play is treating a sum as an integral, and choosing a very small parameter to create a very small error.