Here is a proof that I'm copypasting from my old homework. It proves a bit more (see Theorem 3) and does not use the explicit formula for $\phi$ through the prime factorization.
Let $\phi$ denote Euler's totient function.
Lemma 1. Let $m$ and $k$ be positive integers. Let $s\in\mathbb{Z}$.
(a) We have
\begin{align}
& \left( \text{the number of integers among }ms+1,\ ms+2,\ \ldots
,\ ms+m\text{ that are coprime to }m\right) \nonumber\\
& =\phi\left( m\right) .
\label{darij1.p11.claim1}
\tag{1}
\end{align}
(b) Let $x\in\left\{ 1,2,\ldots,m\right\} $. The integer $ms+x$ is
coprime to $m$ if and only if $x$ is coprime to $m$.
Proof of Lemma 1. (b) If $d$ is a common divisor of $ms+x$ and $m$, then
$d$ must also divide $x$ (since $d\mid ms+x$ and $d\mid m$, so that
\begin{equation}
x=\underbrace{\left( ms+x\right) }_{\substack{\equiv0\mod
d\\\text{(since }d\mid ms+x\text{)}}}-\underbrace{m}_{\substack{\equiv
0\mod d\\\text{(since }d\mid m\text{)}}}s\equiv
0-0s=0\mod d,
\end{equation}
so that $d\mid x$), and thus $d$ must be a common divisor of $x$ and $m$. In
other words, each common divisor of $ms+x$ and $m$ must be a common divisor of
$x$ and $m$.
If $d$ is a common divisor of $x$ and $m$, then $d$ must also divide $ms+x$
(since $d\mid x$ and $d\mid m$, so that
\begin{equation}
\underbrace{m}_{\substack{\equiv0\mod d\\\text{(since }d\mid
m\text{)}}}s+\underbrace{x}_{\substack{\equiv0\mod
d\\\text{(since }d\mid x\text{)}}}\equiv0s+0=0\mod d,
\end{equation}
so that $d\mid ms+x$), and thus $d$ must be a common divisor of $ms+x$ and
$m$. In other words, each common divisor of $x$ and $m$ must be a common
divisor of $ms+x$ and $m$.
We have thus shown that:
Combining these two statements, we conclude that the common divisors of $ms+x$
and $m$ are exactly the common divisors of $x$ and $m$. Thus, the greatest
common divisor of $ms+x$ and $m$ is the greatest common divisor of $x$ and
$m$. In other words, $\gcd\left( ms+x,m\right) =\gcd\left( x,m\right) $.
Now, we have the following equivalence of statements:
\begin{align*}
\left( ms+x\text{ is coprime to }m\right) \ & \Longleftrightarrow\ \left(
\underbrace{\gcd\left( ms+x,m\right) }_{=\gcd\left( x,m\right) }=1\right)
\\
& \Longleftrightarrow\ \left( \gcd\left( x,m\right) =1\right)
\ \Longleftrightarrow\ \left( x\text{ is coprime to }m\right) .
\end{align*}
This proves Lemma 1 (b).
(a) We have
\begin{align*}
& \left( \text{the number of integers among }ms+1,\ ms+2,\ \ldots
,\ ms+m\text{ that are coprime to }m\right) \\
& =\left\vert \left\{ x\in\left\{ 1,2,\ldots,m\right\} \ \mid
\ \underbrace{ms+x\text{ is coprime to }m}_{\substack{\text{this is equivalent
to}\\x\text{ being coprime to }m\\\text{(by Lemma 1 (b))}}}\right\}
\right\vert \\
& =\left\vert \left\{ x\in\left\{ 1,2,\ldots,m\right\} \ \mid\ x\text{ is
coprime to }m\right\} \right\vert \\
& =\left( \text{the number of integers among }1,\ 2,\ \ldots,\ m\text{ that
are coprime to }m\right) \\
& =\left( \text{the number of }x\in\left\{ 1,2,\ldots,m\right\} \text{
that are coprime to }m\right) \\
& =\phi\left( m\right)
\end{align*}
(since $\phi\left( m\right) $ is defined as the number of $x\in\left\{
1,2,\ldots,m\right\} $ that are coprime to $m$). This proves Lemma 1 (a).
$\blacksquare$
Lemma 2. Let $m$ and $k$ be positive integers. Then, the number of
positive integers $\leq mk$ that are coprime to $m$ is $k\phi\left( m\right)
$.
Proof of Lemma 2. We have
\begin{align*}
& \left( \text{the number of positive integers }\leq mk\text{ that are
coprime to }m\right) \\
& =\left( \text{the number of integers among }1,\ 2,\ \ldots,\ mk\text{ that
are coprime to }m\right) \\
& =\sum_{s=0}^{k-1}\underbrace{\left( \text{the number of integers among
}ms+1,\ ms+2,\ \ldots,\ ms+m\text{ that are coprime to }m\right)
}_{\substack{=\phi\left( m\right) \\\text{(by \eqref{darij1.p11.claim1})}}}\\
& \qquad\qquad\left(
\begin{array}
[c]{c}
\text{since each of the integers }1,\ 2,\ \ldots,\ mk\text{ belongs to exactly
one}\\
\text{of the }k\text{ lists }\left( 1,\ 2,\ \ldots,\ m\right) ,\ \left(
m+1,\ m+2,\ \ldots,\ 2m\right) ,\ \ldots,\\
\left( m\left( k-1\right) +1,\ m\left( k-1\right) +2,\ \ldots
,\ mk\right) \text{; in other words, each}\\
\text{of the integers }1,\ 2,\ \ldots,\ mk\text{ belongs to exactly one of the
}k\\
\text{lists }\left( ms+1,\ ms+2,\ \ldots,\ ms+m\right) \text{ with }
s\in\left\{ 0,1,\ldots,k-1\right\}
\end{array}
\right) \\
& =\sum_{s=0}^{k-1}\phi\left( m\right) =k\phi\left( m\right) .
\end{align*}
This proves Lemma 2. $\blacksquare$
Theorem 3. Let $m$ and $n$ be two positive integers. Assume that every
prime that divides $n$ also divides $m$. Then:
(a) For every integer $x$, we have the following logical equivalence:
\begin{equation}
\left( x\text{ is coprime to }m\right) \Longleftrightarrow\left( x\text{ is
coprime to }mn\right) .
\label{darij1.p12.c1}
\tag{2}
\end{equation}
(b) We have $\phi\left( nm\right) =n\phi\left( m\right) $.
Proof of Theorem 3. (a) Let $x$ be an integer.
Proof of the $\Longrightarrow$ direction of \eqref{darij1.p12.c1}:
Assume
that $x$ is coprime to $m$. Thus, $\gcd\left( x,m\right) =1$. Hence, no
prime can divide both $m$ and $x$. Now, we shall prove that $x$ is coprime to
$mn$. Indeed, assume the contrary. That is, $x$ is not coprime to $mn$; thus,
$\gcd\left( x,mn\right) >1$. Hence, there exists a prime $p$ which divides
$\gcd\left( x,mn\right) $. Consider this $p$. Then, $p\mid\gcd\left(
x,mn\right) \mid mn$. Since $p$ is a prime, this yields that we have $p\mid
m$ or $p\mid n$. If we had $p\mid m$, then the prime $p$ would divide both $m$
and $x$ (because $p\mid m$ and $p\mid\gcd\left( x,mn\right) \mid x$); this
would contradict the fact that no prime can divide both $m$ and $x$. Hence, we
cannot have $p\mid m$. Thus, we must have $p\mid n$ (since we have $p\mid m$
or $p\mid n$). Since $p$ is a prime, we thus conclude that $p\mid m$ (due to
our assumption that every prime that divides $n$ also divides $m$). This
contradicts the fact that we cannot have $p\mid m$. This contradiction shows
that our assumption was false. Hence, we have shown that $x$ is coprime to
$mn$. The $\Longrightarrow$ direction of \eqref{darij1.p12.c1} is thus proven.
Proof of the $\Longleftarrow$ direction of \eqref{darij1.p12.c1}:
Assume
that $x$ is coprime to $mn$. Thus, $\gcd\left( x,mn\right) =1$. Now, we
shall prove that $x$ is coprime to $m$. Indeed, assume the contrary. That is,
$x$ is not coprime to $m$; thus, $\gcd\left( x,m\right) >1$. Hence, there
exists a prime $p$ which divides $\gcd\left( x,m\right) $. Consider this
$p$. Then, $p\mid\gcd\left( x,m\right) \mid x$ and $p\mid\gcd\left(
x,m\right) \mid m\mid mn$. Hence, $p$ is a common divisor of the numbers $x$
and $mn$, and therefore divides their greatest common divisor. In other words,
$p\mid\gcd\left( x,mn\right) =1$. So we have $p\mid1$. This is absurd, since
$p$ is a prime. This contradiction shows that our assumption was false. Hence,
we have shown that $x$ is coprime to $m$. The $\Longleftarrow$ direction of
\eqref{darij1.p12.c1} is thus proven.
Now, with both directions of \eqref{darij1.p12.c1} being proven, the proof of
\eqref{darij1.p12.c1} is complete. In other words, Theorem 3 (a) is proven.
(b) Lemma 2 (applied to $k=n$) yields that the number of positive integers
$\leq mn$ that are coprime to $m$ is $n\phi\left( m\right) $. Thus,
\begin{align*}
n\phi\left( m\right) & =\left( \text{the number of positive integers
}\leq mn\text{ that are coprime to }m\right) \\
& =\left( \text{the number of }x\in\left\{ 1,2,\ldots,mn\right\} \text{
such that }\underbrace{x\text{ is coprime to }m}
_{\substack{\Longleftrightarrow\left( x\text{ is coprime to }mn\right)
\\\text{(due to \eqref{darij1.p12.c1})}}}\right) \\
& =\left( \text{the number of }x\in\left\{ 1,2,\ldots,mn\right\} \text{
such that }x\text{ is coprime to }mn\right) \\
& =\phi\left( mn\right)
\end{align*}
(since $\phi\left( mn\right) $ is defined as the number of $x\in\left\{
1,2,\ldots,mn\right\} $ such that $x$ is coprime to $mn$). This proves Theorem
3 (b). $\blacksquare$
Corollary 4. Let $m$ and $n$ be two positive integers such that $n\mid m$.
Then, $\phi\left( nm\right) =n\phi\left( m\right) $.
Proof of Corollary 4. Every prime that divides $n$ also divides $m$ (since
$n\mid m$). Hence, Theorem 3 (b) yields $\phi\left( nm\right)
=n\phi\left( m\right) $. This proves Corollary 4. $\blacksquare$
Corollary 4 is your question (with $d$ and $n$ renamed as $n$ and $m$).
This is a very nice problem! I see two separate problems in the proof; one easy to fix, one not so much. The "big" one explains why there must be difference between $L(n)$ and the correct value of the sum. On the other hand, the "easy" one actually made the expression closer to the expected values; thus adding to the confusion.
We'll start with the "easy" one: The proof works by expressing a specific probability in two different ways. Since we are looking for exact match rather than just some kind of asymptotic behaviour, we need to be very careful to make sure it is indeed the same scenario being considered in both cases.
The second part of the proof considers all $N^2$ pairs of integers from the set $\{1,2,\ldots,N\}$ (the two integers in each pair are considered completely independently). On the other hand, the first part of the proof originally considered only pairs distinct integers from the same set, without paying attention to their order. This disregarded the pairs $(i,i)$ completely; even though the numerator of the fraction counted the pair $(1,1)$ as "winning". The attempted fix included the extra "winning" pair $(1,1)$ in the denominator, thus arriving at the expression
$$P(N)\overset{?}{=}\frac{\sum_{k=1}^N \varphi(k)}{\binom{N}{2}+1}$$
This is not sufficient, though, since it ignores the existence of the other ordered pairs of the form $(i,i)$. The correct expression for $P(N)$ looks as follows:
$$P(N)=\frac{1}{N^2}\left(2\sum_{k=1}^N \varphi(k)-1\right)$$
The sum counts the number of winning pairs $(i,j)$ with $1\leq i\leq j\leq N$; this includes the special pair $(1,1)$. Since every pair can also be reversed and yield another valid pair, the sum is doubled; the extra $(-1)$ accounts for the $(1,1)$ being identical to its reversal.
Now, if we apply this correct value of $P(N)$ and equate it to the quantity found by the second approach:
$$P^*(N)=\prod_{p\ prime}\left(1-\frac{1}{N^2}{\left\lfloor{\frac{N}{p}}\right\rfloor}^2\right)$$
we'd get
$$L^*(N)=\frac{1}{2}\left(1+N^2\prod_{p\ prime}\left(1-\frac{1}{N^2}{\left\lfloor{\frac{N}{p}}\right\rfloor}^2\right)\right)$$
As indicated at the beginning, this function is actually worse estimate of $\sum_{k=1}^N\varphi(k)$ than the one provided by incorrect reasoning!
Now, the "big" issue is a lot more subtle and lies in the phrase "But being divisible by a prime number or being divisible by another prime number are independent events.". Is that really the case?
Consider a simpler problem: We are given two distinct primes, $p$ and $q$ and look at positive integers up to $N$. What is the probability of a (uniformly) randomly chosen number not being divisible by $p$? Clearly, it's $\left(1-\frac{1}{N}\left\lfloor\frac{N}{p}\right\rfloor\right)$. The same applies of $q$, of course. But what is the probability of a number being divisible by neither $p$ nor $q$? Is it the product of these two probabilities (as independence would require)?
Sometimes yes, but most of the time no.
For a specific example, consider $N=20$ and $p=7$ and $q=11$. The probability for non-divisibility by $p$ is $\frac{18}{20}$, and by $q$ is $\frac{19}{20}$. However, the probability of "neither $p$, nor $q$" is $\frac{17}{20}$ rather than $\frac{18}{20}\times\frac{19}{20}$. It's not difficult to see why: if $N$ is smaller than $p\times q$, the two divisibility conditions are actually mutually exclusive (which is as far from independence as it can be). Note that even $N$ being greater than $p\times q$ is not sufficient to provide independence; that only happens when $N$ is a multiple of $p\times q$.
Yes, asymptotically, as $N$ grows, the probability will converge to the product of the two probabilities, but for a fixed $N$, there is no guarantee of equality. The whole thing gets even more complicated if we consider more than two primes; and even more so if we are looking at all the primes up to $N$, where even increasing $N$ and looking at asymptotic behaviour is complicated by further and further terms appearing in the product.
The same kind of a problem appears when considering pairs of integers and their common divisors; not-sharing-divisor-$p$ and not-sharing-divisor-$q$ are not really independent.
It is not difficult to see that the mistake of considering the probabilities as independent when they are not over-estimates the correct values; so the values given by $L(N)$ should be overestimates of the desired sums. The values of $L(N)$ are not always so; precisely because of the "easy" mistake. Explaining why those incorrect estimates are better would most likely require much deeper analysis of the interplay between primes.
Best Answer
Your proof is valid (assuming you already proved the facts you used about $\phi$). Both formulas are practically equivalent
$$\prod_{i=1}^n (p_i^{a_i}-p_i^{a_i-1} ) =\prod_{i=1}^n p_i^{a_i}\left(1-\frac{1}{p_i}\right) = m \prod_{i=1}^n \left(1-\frac{1}{p_i}\right) $$
and both are widely used.